cleanup on resource check
Subsystems (2)
v2 cover cleanup on resource check
This series removes the duplication of sanity check for platform_get_resource() return resource. It will be checked with devm_ioremap_resource()
Series based on devel branch of [1].
[1]: https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git
Varka Bhadram (3):
gpio: gpio-davinci: remove duplicate check on resource
gpio: gpio-stp-xway: remove duplicate check on resource
gpio: gpio-tb10x: remove duplicate check on resource
drivers/gpio/gpio-davinci.c | 5 ----- drivers/gpio/gpio-stp-xway.c | 8 ++------ drivers/gpio/gpio-tb10x.c | 7 +------ 3 files changed, 3 insertions(+), 17 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v2 1/3 gpio: gpio-davinci: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource().
--- drivers/gpio/gpio-davinci.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/gpio/gpio-davinci.c +0 -5
@@ -234,11 +234,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)return -ENOMEM ; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (dev,"Invalid memory resource\n" ); -return -EBUSY ; - } - gpio_base =devm_ioremap_resource (dev, res);if (IS_ERR (gpio_base))return PTR_ERR (gpio_base);
Signature · 1 line
1.7.9.5
Re: [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource
Quoted 4 lines · Varka Bhadram
Sanity check on resource happening with
devm_ioremap_resource().Signed-off-by Varka Bhadram <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH v2 2/3 gpio: gpio-stp-xway: remove duplicate check on resource
In reply to Varka BhadramSanity check on resource happening with devm_ioremap_resource().
--- drivers/gpio/gpio-stp-xway.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpio/gpio-stp-xway.c +2 -6
@@ -199,21 +199,17 @@ static int xway_stp_hw_init(struct xway_stp *chip)static int xway_stp_probe (struct platform_device *pdev) { -struct resource *res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +struct resource *res;const __be32 *shadow, *groups, *dsl, *phy;struct xway_stp *chip;struct clk *clk;int ret =0 ; -if (!res) { -dev_err (&pdev->dev,"failed to request STP resource\n" ); -return -ENOENT ; - } - chip =devm_kzalloc (&pdev->dev,sizeof (*chip),GFP_KERNEL );if (!chip)return -ENOMEM ; + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); chip->virt =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (chip->virt))return PTR_ERR (chip->virt);
Signature · 1 line
1.7.9.5
Re: [PATCH gpio v2 2/3] gpio: gpio-stp-xway: remove duplicate check on resource
Quoted 4 lines · Varka Bhadram
Sanity check on resource happening with
devm_ioremap_resource().Signed-off-by Varka Bhadram <[email protected]>
I've already applied a version of this patch.
Yours,
Linus Walleij
PATCH v2 3/3 gpio: gpio-tb10x: remove duplicate check on resource
In reply to Varka BhadramSanity check on resource happening with devm_ioremap_resource().
--- drivers/gpio/gpio-tb10x.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpio/gpio-tb10x.c +1 -6
@@ -195,18 +195,13 @@ static int tb10x_gpio_probe(struct platform_device *pdev)if (of_property_read_u32 (dn,"abilis,ngpio" , &ngpio))return -EINVAL ; - mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem) { -dev_err (&pdev->dev,"No memory resource defined.\n" ); -return -EINVAL ; - } - tb10x_gpio =devm_kzalloc (&pdev->dev,sizeof (*tb10x_gpio),GFP_KERNEL );if (tb10x_gpio ==NULL )return -ENOMEM ;spin_lock_init (&tb10x_gpio->spinlock); + mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); tb10x_gpio->base =devm_ioremap_resource (&pdev->dev, mem);if (IS_ERR (tb10x_gpio->base))return PTR_ERR (tb10x_gpio->base);
Signature · 1 line
1.7.9.5
Re: [PATCH gpio v2 3/3] gpio: gpio-tb10x: remove duplicate check on resource
Quoted 4 lines · Varka Bhadram
Sanity check on resource happening with
devm_ioremap_resource().Signed-off-by Varka Bhadram <[email protected]>
Already applied a version of this patch.
Yours,
Linus Walleij