mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] mfd: timberdale: Staticize local variables
@ 2013-08-23 10:11 Sachin Kamat
  2013-08-23 10:11 ` [PATCH 2/3] mfd: timberdale: Remove redundant break Sachin Kamat
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sachin Kamat @ 2013-08-23 10:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: lee.jones, sameo, sachin.kamat

Local variables referenced only in this file are made static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mfd/timberdale.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 0c1fcbc..4c9c149 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -115,11 +115,11 @@ static const struct resource timberdale_ocores_resources[] = {
 	},
 };
 
-const struct max7301_platform_data timberdale_max7301_platform_data = {
+static const struct max7301_platform_data timberdale_max7301_platform_data = {
 	.base = 200
 };
 
-const struct mc33880_platform_data timberdale_mc33880_platform_data = {
+static const struct mc33880_platform_data timberdale_mc33880_platform_data = {
 	.base = 100
 };
 
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] mfd: timberdale: Remove redundant break
  2013-08-23 10:11 [PATCH 1/3] mfd: timberdale: Staticize local variables Sachin Kamat
@ 2013-08-23 10:11 ` Sachin Kamat
  2013-08-23 10:11 ` [PATCH 3/3] mfd: timberdale: Use module_pci_driver Sachin Kamat
  2013-08-23 10:39 ` [PATCH 1/3] mfd: timberdale: Staticize local variables Lee Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Sachin Kamat @ 2013-08-23 10:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: lee.jones, sameo, sachin.kamat

break after goto is unreachable. Delete it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mfd/timberdale.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 4c9c149..57dd89d 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -781,7 +781,6 @@ static int timb_probe(struct pci_dev *dev,
 			priv->fw.major, priv->fw.minor, ip_setup);
 		err = -ENODEV;
 		goto err_mfd;
-		break;
 	}
 
 	if (err) {
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] mfd: timberdale: Use module_pci_driver
  2013-08-23 10:11 [PATCH 1/3] mfd: timberdale: Staticize local variables Sachin Kamat
  2013-08-23 10:11 ` [PATCH 2/3] mfd: timberdale: Remove redundant break Sachin Kamat
@ 2013-08-23 10:11 ` Sachin Kamat
  2013-08-23 10:39 ` [PATCH 1/3] mfd: timberdale: Staticize local variables Lee Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Sachin Kamat @ 2013-08-23 10:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: lee.jones, sameo, sachin.kamat

module_pci_driver removes some boilerplate and makes the code
simple.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mfd/timberdale.c |   29 +----------------------------
 1 files changed, 1 insertions(+), 28 deletions(-)

diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 57dd89d..a6755ec 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -868,34 +868,7 @@ static struct pci_driver timberdale_pci_driver = {
 	.remove = timb_remove,
 };
 
-static int __init timberdale_init(void)
-{
-	int err;
-
-	err = pci_register_driver(&timberdale_pci_driver);
-	if (err < 0) {
-		printk(KERN_ERR
-			"Failed to register PCI driver for %s device.\n",
-			timberdale_pci_driver.name);
-		return -ENODEV;
-	}
-
-	printk(KERN_INFO "Driver for %s has been successfully registered.\n",
-		timberdale_pci_driver.name);
-
-	return 0;
-}
-
-static void __exit timberdale_exit(void)
-{
-	pci_unregister_driver(&timberdale_pci_driver);
-
-	printk(KERN_INFO "Driver for %s has been successfully unregistered.\n",
-		timberdale_pci_driver.name);
-}
-
-module_init(timberdale_init);
-module_exit(timberdale_exit);
+module_pci_driver(timberdale_pci_driver);
 
 MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");
 MODULE_VERSION(DRV_VERSION);
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] mfd: timberdale: Staticize local variables
  2013-08-23 10:11 [PATCH 1/3] mfd: timberdale: Staticize local variables Sachin Kamat
  2013-08-23 10:11 ` [PATCH 2/3] mfd: timberdale: Remove redundant break Sachin Kamat
  2013-08-23 10:11 ` [PATCH 3/3] mfd: timberdale: Use module_pci_driver Sachin Kamat
@ 2013-08-23 10:39 ` Lee Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2013-08-23 10:39 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, sameo

On Fri, 23 Aug 2013, Sachin Kamat wrote:

> Local variables referenced only in this file are made static.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/mfd/timberdale.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

All three patches applied, thanks.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-23 10:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-23 10:11 [PATCH 1/3] mfd: timberdale: Staticize local variables Sachin Kamat
2013-08-23 10:11 ` [PATCH 2/3] mfd: timberdale: Remove redundant break Sachin Kamat
2013-08-23 10:11 ` [PATCH 3/3] mfd: timberdale: Use module_pci_driver Sachin Kamat
2013-08-23 10:39 ` [PATCH 1/3] mfd: timberdale: Staticize local variables Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®