2013-08-23 10:11:20

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 1/3] mfd: timberdale: Staticize local variables

Local variables referenced only in this file are made static.

Signed-off-by: Sachin Kamat <[email protected]>
---
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


2013-08-23 10:11:25

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 2/3] mfd: timberdale: Remove redundant break

break after goto is unreachable. Delete it.

Signed-off-by: Sachin Kamat <[email protected]>
---
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

2013-08-23 10:11:31

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 3/3] mfd: timberdale: Use module_pci_driver

module_pci_driver removes some boilerplate and makes the code
simple.

Signed-off-by: Sachin Kamat <[email protected]>
---
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 <[email protected]>");
MODULE_VERSION(DRV_VERSION);
--
1.7.4.1

2013-08-23 10:39:35

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: timberdale: Staticize local variables

On Fri, 23 Aug 2013, Sachin Kamat wrote:

> Local variables referenced only in this file are made static.
>
> Signed-off-by: Sachin Kamat <[email protected]>
> ---
> 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