i2c: busses: convert to devm_platform_get_and_ioremap_resource
Subsystems (6)
PATCH 1/1 i2c: busses: convert to devm_platform_get_and_ioremap_resource
use devm_platform_get_and_ioremap_resource() to simplify code, which contains platform_get_resource() and devm_ioremap_resource(), it also get the resource for use by the following code.
--- drivers/i2c/busses/i2c-cadence.c | 3 +-- drivers/i2c/busses/i2c-pca-platform.c | 3 +-- drivers/i2c/busses/i2c-rcar.c | 4 +--- drivers/i2c/busses/i2c-stm32f7.c | 3 +-- 4 files changed, 4 insertions(+), 9 deletions(-)
drivers/i2c/busses/i2c-cadence.c +1 -2
@@ -906,8 +906,7 @@ static int cdns_i2c_probe(struct platform_device *pdev) id->quirks = data->quirks; } - r_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - id->membase =devm_ioremap_resource (&pdev->dev, r_mem); + id->membase =devm_platform_get_and_ioremap_resource (pdev,0 , &r_mem);if (IS_ERR (id->membase))return PTR_ERR (id->membase);
drivers/i2c/busses/i2c-pca-platform.c +1 -2
@@ -149,8 +149,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev)if (!i2c)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - i2c->reg_base =devm_ioremap_resource (&pdev->dev, res); + i2c->reg_base =devm_platform_get_and_ioremap_resource (pdev,0 , &res);if (IS_ERR (i2c->reg_base))return PTR_ERR (i2c->reg_base);
drivers/i2c/busses/i2c-rcar.c +1 -3
@@ -938,9 +938,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)return PTR_ERR (priv->clk); } - priv->res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - - priv->io =devm_ioremap_resource (dev, priv->res); + priv->io =devm_platform_get_and_ioremap_resource (pdev,0 , &priv->res);if (IS_ERR (priv->io))return PTR_ERR (priv->io);
drivers/i2c/busses/i2c-stm32f7.c +1 -2
@@ -1940,8 +1940,7 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)if (!i2c_dev)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - i2c_dev->base =devm_ioremap_resource (&pdev->dev, res); + i2c_dev->base =devm_platform_get_and_ioremap_resource (pdev,0 , &res);if (IS_ERR (i2c_dev->base))return PTR_ERR (i2c_dev->base); phy_addr = (dma_addr_t )res->start;
Signature · 1 line
2.25.0
Wolfram Sang
AppliedQuoted 5 lines · Dejin Zheng
use
devm_platform_get_and_ioremap_resource()to simplify code, which containsplatform_get_resource()anddevm_ioremap_resource(), it also get the resource for use by the following code.Signed-off-by Dejin Zheng <[email protected]>
Applied to for-next, because it seems 'the new way' but...
drivers/i2c/busses/i2c-cadence.c static int cdns_i2c_probe(struct platform_device *pdev) · line 909
Quoted 3 lines
drivers/i2c/busses/i2c-cadence.c +1
-2- r_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - id->membase =devm_ioremap_resource (&pdev->dev, r_mem); + id->membase =devm_platform_get_and_ioremap_resource (pdev,0 , &r_mem);
... guys, do you really think this one line reduction improves readability? Oh well...
Quoted 7 lines · Wolfram Sang
Quoted 5 lines · Dejin Zheng
use
devm_platform_get_and_ioremap_resource()to simplify code, which containsplatform_get_resource()anddevm_ioremap_resource(), it also get the resource for use by the following code.Signed-off-by Dejin Zheng <[email protected]>
Quoted 9 lines
Applied to for-next, because it seems 'the new way' but...
drivers/i2c/busses/i2c-cadence.c static int cdns_i2c_probe(struct platform_device *pdev) · line 909
Quoted 3 lines
drivers/i2c/busses/i2c-cadence.c +1
-2- r_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - id->membase =devm_ioremap_resource (&pdev->dev, r_mem); + id->membase =devm_platform_get_and_ioremap_resource (pdev,0 , &r_mem);... guys, do you really think this one line reduction improves readability? Oh well...
Wolfram, Thank you for accepting it. From my personal point of view, as long as the direction is correct, even small improvements are worth doing. Thanks again for your tolerance.
BR,
Dejin
Quoted 15 lines · Dejin Zheng
Quoted 13 lines · Wolfram Sang
Quoted 5 lines · Dejin Zheng
use
devm_platform_get_and_ioremap_resource()to simplify code, which containsplatform_get_resource()anddevm_ioremap_resource(), it also get the resource for use by the following code.Signed-off-by Dejin Zheng <[email protected]>Applied to for-next, because it seems 'the new way' but...
Quoted 3 lines
drivers/i2c/busses/i2c-cadence.c +1
-2- r_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - id->membase =devm_ioremap_resource (&pdev->dev, r_mem); + id->membase =devm_platform_get_and_ioremap_resource (pdev,0 , &r_mem);
Quoted 6 lines
Quoted 3 lines
... guys, do you really think this one line reduction improves readability? Oh well...
Wolfram, Thank you for accepting it. From my personal point of view, as long as the direction is correct, even small improvements are worth doing. Thanks again for your tolerance.
Do you have plans to move on from janitor work to something serious?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Dejin Zheng
Quoted 13 lines · Wolfram Sang
Quoted 5 lines · Dejin Zheng
use
devm_platform_get_and_ioremap_resource()to simplify code, which containsplatform_get_resource()anddevm_ioremap_resource(), it also get the resource for use by the following code.Signed-off-by Dejin Zheng <[email protected]>Applied to for-next, because it seems 'the new way' but...
Quoted 3 lines
drivers/i2c/busses/i2c-cadence.c +1
-2- r_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - id->membase =devm_ioremap_resource (&pdev->dev, r_mem); + id->membase =devm_platform_get_and_ioremap_resource (pdev,0 , &r_mem);
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
... guys, do you really think this one line reduction improves readability? Oh well...
Wolfram, Thank you for accepting it. From my personal point of view, as long as the direction is correct, even small improvements are worth doing. Thanks again for your tolerance.
Do you have plans to move on from janitor work to something serious?
Andy, I want to do��but I don��t know where to start, Could you give me some suggestions? Thanks very much!
BR,
Dejin
Quoted 3 lines
Signature · 2 lines
With Best Regards, Andy Shevchenko
On Sat, Apr 18, 2020 at 7:07 AM Dejin Zheng <[email protected]> wrote:
Leave only you and i2c ML to avoid spamming people.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Wolfram, Thank you for accepting it. From my personal point of view, as long as the direction is correct, even small improvements are worth doing. Thanks again for your tolerance.
Do you have plans to move on from janitor work to something serious?
Andy, I want to do��but I don��t know where to start, Could you give me some suggestions? Thanks very much!
I have been collecting some items on my Gist page [1], where anybody (depending on the skills) can find affordable tasks. Tell me if you need elaboration.
[1]: https://gist.github.com/andy-shev/a2cb1ee4767d6d2f5d20db53ecb9aabc
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
On Sat, Apr 18, 2020 at 7:07 AM Dejin Zheng <[email protected]> wrote:
Leave only you and i2c ML to avoid spamming people.
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Wolfram, Thank you for accepting it. From my personal point of view, as long as the direction is correct, even small improvements are worth doing. Thanks again for your tolerance.
Do you have plans to move on from janitor work to something serious?
Quoted 9 lines
Quoted 2 lines
Andy, I want to do��but I don��t know where to start, Could you give me some suggestions? Thanks very much!
I have been collecting some items on my Gist page [1], where anybody (depending on the skills) can find affordable tasks. Tell me if you need elaboration.
[1]: https://gist.github.com/andy-shev/a2cb1ee4767d6d2f5d20db53ecb9aabc
Andy, thank you very much for your suggestion. I will study your Gist page first. If there is something I don't understand, I will consult you again. Thanks again for your help!
BR,
Dejin
Quoted 3 lines
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
On Sat, Apr 18, 2020 at 7:07 AM Dejin Zheng <[email protected]> wrote:
Leave only you and i2c ML to avoid spamming people.
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Wolfram, Thank you for accepting it. From my personal point of view, as long as the direction is correct, even small improvements are worth doing. Thanks again for your tolerance.
Do you have plans to move on from janitor work to something serious?
Quoted 9 lines
Quoted 2 lines
Andy, I want to do��but I don��t know where to start, Could you give me some suggestions? Thanks very much!
I have been collecting some items on my Gist page [1], where anybody (depending on the skills) can find affordable tasks. Tell me if you need elaboration.
[1]: https://gist.github.com/andy-shev/a2cb1ee4767d6d2f5d20db53ecb9aabc
Andy, your Gist page is really very suitable for me, I think I should be able to start with the following two cases:
5. Run codespell across drivers and subsystems
6. Fix ioremap(..., 0) [size = 0] across architectures, now some return NULL, some return address, some may even have leaks
If I have any related commits, I will CC with you. Thanks!
BR,
Dejin
Quoted 3 lines
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 2 lines
5. Run
codespellacross drivers and subsystems
I think Colin King is already working on that. I regularly get patches from him doing that.
Quoted 2 lines
6. Fix
ioremap(..., 0)[size = 0] across architectures, now some return NULL, some return address, some may even have leaks
This sounds more useful to me. Would be great if you have interest.
Quoted 7 lines · Wolfram Sang
Quoted 3 lines
5. Run
codespellacross drivers and subsystemsI think Colin King is already working on that. I regularly get patches from him doing that.
I think CI should integrate it in their workflow,
LKP guys, what do you think?
Quoted 4 lines
Quoted 2 lines
6. Fix
ioremap(..., 0)[size = 0] across architectures, now some return NULL, some return address, some may even have leaksThis sounds more useful to me. Would be great if you have interest.
But it much more advanced :-) Complete dive into the kernel guts.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
6. Fix
ioremap(..., 0)[size = 0] across architectures, now some return NULL, some return address, some may even have leaksThis sounds more useful to me. Would be great if you have interest.
But it much more advanced :-) Complete dive into the kernel guts.
Well, learning by doing :) Dejin seems interested...
Quoted 10 lines · Wolfram Sang
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
6. Fix
ioremap(..., 0)[size = 0] across architectures, now some return NULL, some return address, some may even have leaksThis sounds more useful to me. Would be great if you have interest.
But it much more advanced :-) Complete dive into the kernel guts.
Well, learning by doing :) Dejin seems interested...
I do my best to try, Thank you all for your encouragement and help.
BR,
Dejin
Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Wolfram Sang
Quoted 3 lines
5. Run
codespellacross drivers and subsystems
Quoted 7 lines
Quoted 3 lines
I think Colin King is already working on that. I regularly get patches from him doing that.
I think CI should integrate it in their workflow,
LKP guys, what do you think?
thanks, this looks valuable, we will investigate the tool to see how we can integrate it to our testing flow.
Quoted 15 lines
Quoted 5 lines
Quoted 3 lines
6. Fix
ioremap(..., 0)[size = 0] across architectures, now some return NULL, some return address, some may even have leaksThis sounds more useful to me. Would be great if you have interest.
But it much more advanced :-) Complete dive into the kernel guts.
Signature · 5 lines
With Best Regards, Andy Shevchenko _______________________________________________ LKP mailing list -- lkp(a)lists.01.org To unsubscribe send an email to lkp-leave(a)lists.01.org