From patchwork Mon Mar 16 17:14:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 6023181 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 122F99F2A9 for ; Mon, 16 Mar 2015 17:14:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78D0C20445 for ; Mon, 16 Mar 2015 17:14:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5E3B20437 for ; Mon, 16 Mar 2015 17:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933114AbbCPRO0 (ORCPT ); Mon, 16 Mar 2015 13:14:26 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:34064 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932398AbbCPROZ (ORCPT ); Mon, 16 Mar 2015 13:14:25 -0400 Received: by lbbsy1 with SMTP id sy1so35727278lbb.1 for ; Mon, 16 Mar 2015 10:14:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=dYTYFmqgrILGyS7SXS5mTUmG6dApgqNi54qDKPUD5pc=; b=ACUqTipabgC6HzfL6I9MgbX0C3/aAkGprH3FbGzW3chIfEBv92hRGlELLosO7iYaWz 3SQyqCokAET8OEIiTbVg/4tC7tVbeVERKXcBsaZymWs2UsjR4LRDmNReqQqlJSRsckPi fD2ZCxL9n1nOKILqTV2gjtsD/Ah18bI8HsbfUrvDvvedd2FgtRAv8coxVAFPIzfZVIsH nzI+jEv7nAQCtYzGsQGEZiQjBweyd9ksHSSvOv5sOahLe9qKbC7khOmrZFUneZY8ytNV gu31elE+aQkuaprP8g+lDuVGoG9qKczPjcJ14wRci8dBL7+a5OEN4Y4+qcHUmIV5ynJl avTA== X-Gm-Message-State: ALoCoQn5HelVdSsTeHfhbMsAZfsKVxkJTgztgAS7LtP4Ezawc6aJYMfe/NBHNlWeHTdAtVOEzelC X-Received: by 10.152.21.8 with SMTP id r8mr36873300lae.98.1426526063628; Mon, 16 Mar 2015 10:14:23 -0700 (PDT) Received: from dl160.lan (37-33-50-203.bb.dnainternet.fi. [37.33.50.203]) by mx.google.com with ESMTPSA id o4sm2300930lah.28.2015.03.16.10.14.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Mar 2015 10:14:22 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen Subject: [PATCH 1/3] dw2102: combine su3000_state and s6x0_state into dw2102_state Date: Mon, 16 Mar 2015 19:14:04 +0200 Message-Id: <1426526046-2063-1-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Two separate state structs are defined for different devices inside the dw2102. Combine them, as both only contain one element. This will also make it easier to implement the next patch in the patch series. Signed-off-by: Olli Salonen Reviewed-by: Antti Palosaari --- drivers/media/usb/dvb-usb/dw2102.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c index 1a3df10..c68a610 100644 --- a/drivers/media/usb/dvb-usb/dw2102.c +++ b/drivers/media/usb/dvb-usb/dw2102.c @@ -112,11 +112,8 @@ "Please see linux/Documentation/dvb/ for more details " \ "on firmware-problems." -struct su3000_state { +struct dw2102_state { u8 initialized; -}; - -struct s6x0_state { int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v); }; @@ -887,7 +884,7 @@ static int su3000_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) static int su3000_power_ctrl(struct dvb_usb_device *d, int i) { - struct su3000_state *state = (struct su3000_state *)d->priv; + struct dw2102_state *state = (struct dw2102_state *)d->priv; u8 obuf[] = {0xde, 0}; info("%s: %d, initialized %d\n", __func__, i, state->initialized); @@ -973,7 +970,7 @@ static int s660_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) { struct dvb_usb_adapter *d = (struct dvb_usb_adapter *)(fe->dvb->priv); - struct s6x0_state *st = (struct s6x0_state *)d->dev->priv; + struct dw2102_state *st = (struct dw2102_state *)d->dev->priv; dw210x_set_voltage(fe, voltage); if (st->old_set_voltage) @@ -1295,7 +1292,7 @@ static int stv0288_frontend_attach(struct dvb_usb_adapter *d) static int ds3000_frontend_attach(struct dvb_usb_adapter *d) { - struct s6x0_state *st = (struct s6x0_state *)d->dev->priv; + struct dw2102_state *st = d->dev->priv; u8 obuf[] = {7, 1}; d->fe_adap[0].fe = dvb_attach(ds3000_attach, &s660_ds3000_config, @@ -1857,7 +1854,7 @@ static struct dvb_usb_device_properties dw3101_properties = { static struct dvb_usb_device_properties s6x0_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = DEVICE_SPECIFIC, - .size_of_priv = sizeof(struct s6x0_state), + .size_of_priv = sizeof(struct dw2102_state), .firmware = S630_FIRMWARE, .no_reconnect = 1, @@ -1950,7 +1947,7 @@ static struct dvb_usb_device_description d632 = { static struct dvb_usb_device_properties su3000_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = DEVICE_SPECIFIC, - .size_of_priv = sizeof(struct su3000_state), + .size_of_priv = sizeof(struct dw2102_state), .power_ctrl = su3000_power_ctrl, .num_adapters = 1, .identify_state = su3000_identify_state, @@ -2015,7 +2012,7 @@ static struct dvb_usb_device_properties su3000_properties = { static struct dvb_usb_device_properties t220_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = DEVICE_SPECIFIC, - .size_of_priv = sizeof(struct su3000_state), + .size_of_priv = sizeof(struct dw2102_state), .power_ctrl = su3000_power_ctrl, .num_adapters = 1, .identify_state = su3000_identify_state,