public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/4] mtd: denali_dt: Fix incorrect error check
@ 2013-03-18  9:41 Sachin Kamat
  2013-03-18  9:41 ` [PATCH 2/4] mtd: denali_dt: Use module_platform_driver() Sachin Kamat
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sachin Kamat @ 2013-03-18  9:41 UTC (permalink / raw)
  To: linux-mtd; +Cc: sachin.kamat, artem.bityutskiy, dwmw2, dinguyen, dedekind1

The return value of devm_ioremap_nocache should be checked here instead
of res.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Dinh Nguyen <dinguyen@altera.com>
---
This series is compile tested against linux-next tree (20130318).
---
 drivers/mtd/nand/denali_dt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 546f8cb..02988b0 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -42,7 +42,7 @@ static void __iomem *request_and_map(struct device *dev,
 	}
 
 	ptr = devm_ioremap_nocache(dev, res->start, resource_size(res));
-	if (!res)
+	if (!ptr)
 		dev_err(dev, "ioremap_nocache of %s failed!", res->name);
 
 	return ptr;
-- 
1.7.4.1

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

* [PATCH 2/4] mtd: denali_dt: Use module_platform_driver()
  2013-03-18  9:41 [PATCH 1/4] mtd: denali_dt: Fix incorrect error check Sachin Kamat
@ 2013-03-18  9:41 ` Sachin Kamat
  2013-03-18  9:41 ` [PATCH 3/4] mtd: denali_dt: Change return value to fix smatch warning Sachin Kamat
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Sachin Kamat @ 2013-03-18  9:41 UTC (permalink / raw)
  To: linux-mtd; +Cc: sachin.kamat, artem.bityutskiy, dwmw2, dinguyen, dedekind1

module_platform_driver() removes some boilerplate and makes the code
simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mtd/nand/denali_dt.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 02988b0..eb68979 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -150,17 +150,7 @@ static struct platform_driver denali_dt_driver = {
 	},
 };
 
-static int __init denali_init_dt(void)
-{
-	return platform_driver_register(&denali_dt_driver);
-}
-module_init(denali_init_dt);
-
-static void __exit denali_exit_dt(void)
-{
-	platform_driver_unregister(&denali_dt_driver);
-}
-module_exit(denali_exit_dt);
+module_platform_driver(denali_dt_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jamie Iles");
-- 
1.7.4.1

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

* [PATCH 3/4] mtd: denali_dt: Change return value to fix smatch warning
  2013-03-18  9:41 [PATCH 1/4] mtd: denali_dt: Fix incorrect error check Sachin Kamat
  2013-03-18  9:41 ` [PATCH 2/4] mtd: denali_dt: Use module_platform_driver() Sachin Kamat
@ 2013-03-18  9:41 ` Sachin Kamat
  2013-03-18  9:41 ` [PATCH 4/4] mtd: denali_dt: Remove redundant use of of_match_ptr Sachin Kamat
  2013-04-05 12:04 ` [PATCH 1/4] mtd: denali_dt: Fix incorrect error check Artem Bityutskiy
  3 siblings, 0 replies; 6+ messages in thread
From: Sachin Kamat @ 2013-03-18  9:41 UTC (permalink / raw)
  To: linux-mtd; +Cc: sachin.kamat, artem.bityutskiy, dwmw2, dinguyen, dedekind1

platform_get_irq() also returns -ENXIO upon failure.
Use it instead of hardcoded return type.

Fixes the following smatch warning:
drivers/mtd/nand/denali_dt.c:93 denali_dt_probe() info:
why not propagate 'denali->irq' from platform_get_irq() instead of (-6)?

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

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index eb68979..067a505 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -90,7 +90,7 @@ static int denali_dt_probe(struct platform_device *ofdev)
 	denali->irq = platform_get_irq(ofdev, 0);
 	if (denali->irq < 0) {
 		dev_err(&ofdev->dev, "no irq defined\n");
-		return -ENXIO;
+		return denali->irq;
 	}
 
 	denali->flash_reg = request_and_map(&ofdev->dev, denali_reg);
-- 
1.7.4.1

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

* [PATCH 4/4] mtd: denali_dt: Remove redundant use of of_match_ptr
  2013-03-18  9:41 [PATCH 1/4] mtd: denali_dt: Fix incorrect error check Sachin Kamat
  2013-03-18  9:41 ` [PATCH 2/4] mtd: denali_dt: Use module_platform_driver() Sachin Kamat
  2013-03-18  9:41 ` [PATCH 3/4] mtd: denali_dt: Change return value to fix smatch warning Sachin Kamat
@ 2013-03-18  9:41 ` Sachin Kamat
  2013-03-19 16:08   ` Dinh Nguyen
  2013-04-05 12:04 ` [PATCH 1/4] mtd: denali_dt: Fix incorrect error check Artem Bityutskiy
  3 siblings, 1 reply; 6+ messages in thread
From: Sachin Kamat @ 2013-03-18  9:41 UTC (permalink / raw)
  To: linux-mtd; +Cc: sachin.kamat, artem.bityutskiy, dwmw2, dinguyen, dedekind1

Since this driver is dt only and denali_nand_dt_ids is always
compiled in, use of of_match_ptr() macro is not necessary.

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

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 067a505..9253024 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -146,7 +146,7 @@ static struct platform_driver denali_dt_driver = {
 	.driver		= {
 		.name	= "denali-nand-dt",
 		.owner	= THIS_MODULE,
-		.of_match_table	= of_match_ptr(denali_nand_dt_ids),
+		.of_match_table	= denali_nand_dt_ids,
 	},
 };
 
-- 
1.7.4.1

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

* Re: [PATCH 4/4] mtd: denali_dt: Remove redundant use of of_match_ptr
  2013-03-18  9:41 ` [PATCH 4/4] mtd: denali_dt: Remove redundant use of of_match_ptr Sachin Kamat
@ 2013-03-19 16:08   ` Dinh Nguyen
  0 siblings, 0 replies; 6+ messages in thread
From: Dinh Nguyen @ 2013-03-19 16:08 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: dwmw2, dedekind1, linux-mtd, artem.bityutskiy

Hi Sachin,

On Mon, 2013-03-18 at 15:11 +0530, Sachin Kamat wrote:
> Since this driver is dt only and denali_nand_dt_ids is always
> compiled in, use of of_match_ptr() macro is not necessary.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/mtd/nand/denali_dt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
> index 067a505..9253024 100644
> --- a/drivers/mtd/nand/denali_dt.c
> +++ b/drivers/mtd/nand/denali_dt.c
> @@ -146,7 +146,7 @@ static struct platform_driver denali_dt_driver = {
>  	.driver		= {
>  		.name	= "denali-nand-dt",
>  		.owner	= THIS_MODULE,
> -		.of_match_table	= of_match_ptr(denali_nand_dt_ids),
> +		.of_match_table	= denali_nand_dt_ids,
>  	},
>  };
>  

Reviewed-by: Dinh Nguyen <dinguyen@altera.com>

for all 4 patches.

Thanks,
Dinh

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

* Re: [PATCH 1/4] mtd: denali_dt: Fix incorrect error check
  2013-03-18  9:41 [PATCH 1/4] mtd: denali_dt: Fix incorrect error check Sachin Kamat
                   ` (2 preceding siblings ...)
  2013-03-18  9:41 ` [PATCH 4/4] mtd: denali_dt: Remove redundant use of of_match_ptr Sachin Kamat
@ 2013-04-05 12:04 ` Artem Bityutskiy
  3 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2013-04-05 12:04 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: dwmw2, linux-mtd, dinguyen

On Mon, 2013-03-18 at 15:11 +0530, Sachin Kamat wrote:
> The return value of devm_ioremap_nocache should be checked here instead
> of res.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

All look good, pushed the series to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

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

end of thread, other threads:[~2013-04-05 12:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-18  9:41 [PATCH 1/4] mtd: denali_dt: Fix incorrect error check Sachin Kamat
2013-03-18  9:41 ` [PATCH 2/4] mtd: denali_dt: Use module_platform_driver() Sachin Kamat
2013-03-18  9:41 ` [PATCH 3/4] mtd: denali_dt: Change return value to fix smatch warning Sachin Kamat
2013-03-18  9:41 ` [PATCH 4/4] mtd: denali_dt: Remove redundant use of of_match_ptr Sachin Kamat
2013-03-19 16:08   ` Dinh Nguyen
2013-04-05 12:04 ` [PATCH 1/4] mtd: denali_dt: Fix incorrect error check Artem Bityutskiy

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