From patchwork Tue Aug 2 09:03:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leonid V. Fedorenchik" X-Patchwork-Id: 1028422 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7293Ybt007253 for ; Tue, 2 Aug 2011 09:03:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752656Ab1HBJDb (ORCPT ); Tue, 2 Aug 2011 05:03:31 -0400 Received: from mail-pz0-f42.google.com ([209.85.210.42]:55357 "EHLO mail-pz0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314Ab1HBJDa (ORCPT ); Tue, 2 Aug 2011 05:03:30 -0400 Received: by pzk37 with SMTP id 37so13104682pzk.1 for ; Tue, 02 Aug 2011 02:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=YDmiWmuevvgrGuOWcN7ZlittedDDXgFFhBM5iu3Ptc4=; b=J9/ev6rNA3Y6qW/qt/tB4JPwtcFg7I42pj96ZcaJeQ1OCpF6czN/n0WPX0DOZqMoO2 bUxUJcbj5nC7HGvpdT1Fw/mYwt6RvyUtR82pskPTiHI6fLGnoVMav2U6/0FsKVcH3xKs yvsx/odNrg7/wEuWqKhOkXZ+fBftBtOVcncpg= Received: by 10.68.34.170 with SMTP id a10mr9107465pbj.82.1312275809751; Tue, 02 Aug 2011 02:03:29 -0700 (PDT) Received: from localhost.localdomain ([123.119.90.103]) by mx.google.com with ESMTPS id d3sm3877997pbg.60.2011.08.02.02.03.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 02 Aug 2011 02:03:29 -0700 (PDT) From: "Leonid V. Fedorenchik" To: Greg Kroah-Hartman Cc: Mauro Carvalho Chehab , Palash Bandyopadhyay , Ruslan Pisarev , Ilya Gorskin , Joe Perches , Arnd Bergmann , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org, "Leonid V. Fedorenchik" Subject: [PATCH v2] Staging: cx25821: fix coding style issues Date: Tue, 2 Aug 2011 17:03:18 +0800 Message-Id: <1312275798-9669-1-git-send-email-leonidsbox@gmail.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Aug 2011 09:05:24 +0000 (UTC) Fix too long lines in cx25821-audio.h Fix wrong brace placement in cx25821-cards.c, cx25821-core.c, and cx25821-i2c.c Use DEFINE_PCI_DEVICE_TABLE for cx25821_pci_tbl. Move EXPORT_SYMBOL(cx25821_set_gpiopin_direction) to the right place. Delete file cx25821-gpio.h since it is not used. Get rid of typedef in cx25821.h. Signed-off-by: Leonid V. Fedorenchik --- drivers/staging/cx25821/cx25821-audio.h | 6 ++++-- drivers/staging/cx25821/cx25821-cards.c | 2 +- drivers/staging/cx25821/cx25821-core.c | 7 +++---- drivers/staging/cx25821/cx25821-gpio.c | 1 + drivers/staging/cx25821/cx25821-gpio.h | 2 -- drivers/staging/cx25821/cx25821-i2c.c | 6 +++--- drivers/staging/cx25821/cx25821.h | 8 +++++--- 7 files changed, 17 insertions(+), 15 deletions(-) delete mode 100644 drivers/staging/cx25821/cx25821-gpio.h diff --git a/drivers/staging/cx25821/cx25821-audio.h b/drivers/staging/cx25821/cx25821-audio.h index 2771725..a2098fb 100644 --- a/drivers/staging/cx25821/cx25821-audio.h +++ b/drivers/staging/cx25821/cx25821-audio.h @@ -36,13 +36,15 @@ */ #ifndef USE_RISC_NOOP #define MAX_BUFFER_PROGRAM_SIZE \ - (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE*4) + (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE*4) #endif /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */ #ifdef USE_RISC_NOOP #define MAX_BUFFER_PROGRAM_SIZE \ - (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_NOOP_INSTRUCTION_SIZE*4) + (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + \ + RISC_NOOP_INSTRUCTION_SIZE*4) #endif /* Sizes of various instructions in bytes. Used when adding instructions. */ diff --git a/drivers/staging/cx25821/cx25821-cards.c b/drivers/staging/cx25821/cx25821-cards.c index 94e8d68..9f7febd 100644 --- a/drivers/staging/cx25821/cx25821-cards.c +++ b/drivers/staging/cx25821/cx25821-cards.c @@ -57,7 +57,7 @@ struct cx25821_subid cx25821_subids[] = { .subvendor = 0x14f1, .subdevice = 0x0920, .card = CX25821_BOARD, - }, + }, }; void cx25821_card_setup(struct cx25821_dev *dev) diff --git a/drivers/staging/cx25821/cx25821-core.c b/drivers/staging/cx25821/cx25821-core.c index 523ac5e..f06c671 100644 --- a/drivers/staging/cx25821/cx25821-core.c +++ b/drivers/staging/cx25821/cx25821-core.c @@ -1473,17 +1473,17 @@ static void __devexit cx25821_finidev(struct pci_dev *pci_dev) kfree(dev); } -static struct pci_device_id cx25821_pci_tbl[] = { +static DEFINE_PCI_DEVICE_TABLE(cx25821_pci_tbl) = { { /* CX25821 Athena */ .vendor = 0x14f1, .device = 0x8210, .subvendor = 0x14f1, .subdevice = 0x0920, - }, + }, { /* --- end of list --- */ - } + } }; MODULE_DEVICE_TABLE(pci, cx25821_pci_tbl); @@ -1512,7 +1512,6 @@ static void __exit cx25821_fini(void) pci_unregister_driver(&cx25821_pci_driver); } -EXPORT_SYMBOL(cx25821_set_gpiopin_direction); module_init(cx25821_init); module_exit(cx25821_fini); diff --git a/drivers/staging/cx25821/cx25821-gpio.c b/drivers/staging/cx25821/cx25821-gpio.c index 2f154b3..29e43b0 100644 --- a/drivers/staging/cx25821/cx25821-gpio.c +++ b/drivers/staging/cx25821/cx25821-gpio.c @@ -50,6 +50,7 @@ void cx25821_set_gpiopin_direction(struct cx25821_dev *dev, cx_write(gpio_oe_reg, value); } +EXPORT_SYMBOL(cx25821_set_gpiopin_direction); static void cx25821_set_gpiopin_logicvalue(struct cx25821_dev *dev, int pin_number, int pin_logic_value) diff --git a/drivers/staging/cx25821/cx25821-gpio.h b/drivers/staging/cx25821/cx25821-gpio.h deleted file mode 100644 index ca07644..0000000 --- a/drivers/staging/cx25821/cx25821-gpio.h +++ /dev/null @@ -1,2 +0,0 @@ - -void cx25821_gpio_init(struct athena_dev *dev); diff --git a/drivers/staging/cx25821/cx25821-i2c.c b/drivers/staging/cx25821/cx25821-i2c.c index 130dfeb..ea5a878 100644 --- a/drivers/staging/cx25821/cx25821-i2c.c +++ b/drivers/staging/cx25821/cx25821-i2c.c @@ -374,12 +374,12 @@ int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value) .flags = 0, .len = 2, .buf = addr, - }, { + }, { .addr = client->addr, .flags = I2C_M_RD, .len = 4, .buf = buf, - } + } }; addr[0] = (reg_addr >> 8); @@ -407,7 +407,7 @@ int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value) .flags = 0, .len = 6, .buf = buf, - } + } }; buf[0] = reg_addr >> 8; diff --git a/drivers/staging/cx25821/cx25821.h b/drivers/staging/cx25821/cx25821.h index 6230243..a282592 100644 --- a/drivers/staging/cx25821/cx25821.h +++ b/drivers/staging/cx25821/cx25821.h @@ -179,15 +179,17 @@ struct cx25821_input { u32 gpio0, gpio1, gpio2, gpio3; }; -typedef enum { +enum port { CX25821_UNDEFINED = 0, CX25821_RAW, CX25821_264 -} port_t; +}; struct cx25821_board { char *name; - port_t porta, portb, portc; + enum port porta; + enum port portb; + enum port portc; unsigned int tuner_type; unsigned int radio_type; unsigned char tuner_addr;