* [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe()
@ 2019-08-26 12:00 Wei Yongjun
2019-08-26 13:03 ` Dan Carpenter
2019-08-26 23:40 ` Andrew Jeffery
0 siblings, 2 replies; 6+ messages in thread
From: Wei Yongjun @ 2019-08-26 12:00 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson, Joel Stanley, Andrew Jeffery
Cc: linux-mmc, kernel-janitors, Wei Yongjun, linux-aspeed, linux-arm-kernel
In case of error, the function of_platform_device_create() returns
NULL pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
Fixes: 09eed7fffd33 ("mmc: Add support for the ASPEED SD controller")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/mmc/host/sdhci-of-aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
index 8bb095ca2fa9..d5acb5afc50f 100644
--- a/drivers/mmc/host/sdhci-of-aspeed.c
+++ b/drivers/mmc/host/sdhci-of-aspeed.c
@@ -261,9 +261,9 @@ static int aspeed_sdc_probe(struct platform_device *pdev)
struct platform_device *cpdev;
cpdev = of_platform_device_create(child, NULL, &pdev->dev);
- if (IS_ERR(cpdev)) {
+ if (!cpdev) {
of_node_put(child);
- ret = PTR_ERR(cpdev);
+ ret = -ENODEV;
goto err_clk;
}
}
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe()
2019-08-26 12:00 [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe() Wei Yongjun
@ 2019-08-26 13:03 ` Dan Carpenter
2019-08-26 23:37 ` Andrew Jeffery
2019-08-26 23:40 ` Andrew Jeffery
1 sibling, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2019-08-26 13:03 UTC (permalink / raw)
To: Wei Yongjun
Cc: Ulf Hansson, linux-aspeed, Andrew Jeffery, kernel-janitors,
linux-mmc, Adrian Hunter, Joel Stanley, linux-arm-kernel
> Fixes: 09eed7fffd33 ("mmc: Add support for the ASPEED SD controller")
^^^^
When we're adding new files, could we use the prefix for the new driver
instead of just the subsystem? "mmc: aspeed: Add new driver"?
Otherwise it's tricky to know what people want for the driver.
I just wrote this same patch and I swear I would have sent my patch
earlier but I spent hours thinking about the patch prefix and then the
census people came to the house and delayed me even more.
regards,
dan carpenter
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe()
2019-08-26 13:03 ` Dan Carpenter
@ 2019-08-26 23:37 ` Andrew Jeffery
2019-08-27 0:47 ` Julia Lawall
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Jeffery @ 2019-08-26 23:37 UTC (permalink / raw)
To: Dan Carpenter, Wei Yongjun
Cc: Ulf Hansson, linux-aspeed, kernel-janitors, linux-mmc,
Adrian Hunter, Joel Stanley, linux-arm-kernel
On Mon, 26 Aug 2019, at 22:34, Dan Carpenter wrote:
> > Fixes: 09eed7fffd33 ("mmc: Add support for the ASPEED SD controller")
> ^^^^
> When we're adding new files, could we use the prefix for the new driver
> instead of just the subsystem? "mmc: aspeed: Add new driver"?
> Otherwise it's tricky to know what people want for the driver.
I don't have any issue with the request, but I don't understand this last
bit. What do you mean by "it's tricky to know what people want for the
driver"?
Andrew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe()
2019-08-26 12:00 [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe() Wei Yongjun
2019-08-26 13:03 ` Dan Carpenter
@ 2019-08-26 23:40 ` Andrew Jeffery
1 sibling, 0 replies; 6+ messages in thread
From: Andrew Jeffery @ 2019-08-26 23:40 UTC (permalink / raw)
To: Wei Yongjun, Adrian Hunter, Ulf Hansson, Joel Stanley
Cc: kernel-janitors, linux-mmc, linux-arm-kernel, linux-aspeed
On Mon, 26 Aug 2019, at 21:27, Wei Yongjun wrote:
> In case of error, the function of_platform_device_create() returns
> NULL pointer not ERR_PTR(). The IS_ERR() test in the return value
> check should be replaced with NULL test.
>
> Fixes: 09eed7fffd33 ("mmc: Add support for the ASPEED SD controller")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/mmc/host/sdhci-of-aspeed.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-aspeed.c
> b/drivers/mmc/host/sdhci-of-aspeed.c
> index 8bb095ca2fa9..d5acb5afc50f 100644
> --- a/drivers/mmc/host/sdhci-of-aspeed.c
> +++ b/drivers/mmc/host/sdhci-of-aspeed.c
> @@ -261,9 +261,9 @@ static int aspeed_sdc_probe(struct platform_device
> *pdev)
> struct platform_device *cpdev;
>
> cpdev = of_platform_device_create(child, NULL, &pdev->dev);
> - if (IS_ERR(cpdev)) {
> + if (!cpdev) {
> of_node_put(child);
> - ret = PTR_ERR(cpdev);
> + ret = -ENODEV;
> goto err_clk;
> }
> }
I ... have no idea why I wrote it that way. I must have just assumed it returned
an ERR_PTR(). Thanks for finding/fixing that.
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe()
2019-08-26 23:37 ` Andrew Jeffery
@ 2019-08-27 0:47 ` Julia Lawall
2019-08-27 13:49 ` Ulf Hansson
0 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2019-08-27 0:47 UTC (permalink / raw)
To: Andrew Jeffery
Cc: linux-arm-kernel, Ulf Hansson, linux-aspeed, kernel-janitors,
linux-mmc, Adrian Hunter, Wei Yongjun, Joel Stanley,
Dan Carpenter
On Tue, 27 Aug 2019, Andrew Jeffery wrote:
>
>
> On Mon, 26 Aug 2019, at 22:34, Dan Carpenter wrote:
> > > Fixes: 09eed7fffd33 ("mmc: Add support for the ASPEED SD controller")
> > ^^^^
> > When we're adding new files, could we use the prefix for the new driver
> > instead of just the subsystem? "mmc: aspeed: Add new driver"?
> > Otherwise it's tricky to know what people want for the driver.
>
> I don't have any issue with the request, but I don't understand this last
> bit. What do you mean by "it's tricky to know what people want for the
> driver"?
There is no obvious algorithm that tells how to go from a file name to an
appropriate subject line prefix.
julia
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe()
2019-08-27 0:47 ` Julia Lawall
@ 2019-08-27 13:49 ` Ulf Hansson
0 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2019-08-27 13:49 UTC (permalink / raw)
To: Julia Lawall, Dan Carpenter, Andrew Jeffery, Wei Yongjun
Cc: linux-aspeed, linux-mmc, kernel-janitors, Adrian Hunter,
Joel Stanley, Linux ARM
On Tue, 27 Aug 2019 at 02:47, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>
> On Tue, 27 Aug 2019, Andrew Jeffery wrote:
>
> >
> >
> > On Mon, 26 Aug 2019, at 22:34, Dan Carpenter wrote:
> > > > Fixes: 09eed7fffd33 ("mmc: Add support for the ASPEED SD controller")
> > > ^^^^
> > > When we're adding new files, could we use the prefix for the new driver
> > > instead of just the subsystem? "mmc: aspeed: Add new driver"?
> > > Otherwise it's tricky to know what people want for the driver.
> >
> > I don't have any issue with the request, but I don't understand this last
> > bit. What do you mean by "it's tricky to know what people want for the
> > driver"?
>
> There is no obvious algorithm that tells how to go from a file name to an
> appropriate subject line prefix.
For MMC we normally use the name of the host driver file (excluding
".c") as part of the prefix.
For this case that means I amended the header into: mmc:
sdhci-of-aspeed: Fix return value check in aspeed_sdc_probe() and
applied it for next.
I also took the liberty to change this for the other related patches
for the "aspeed" driver to follow the same pattern.
Kind regards
Uffe
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-08-27 13:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26 12:00 [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe() Wei Yongjun
2019-08-26 13:03 ` Dan Carpenter
2019-08-26 23:37 ` Andrew Jeffery
2019-08-27 0:47 ` Julia Lawall
2019-08-27 13:49 ` Ulf Hansson
2019-08-26 23:40 ` Andrew Jeffery
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).