diff options
author | Varka Bhadram <varkabhadram@gmail.com> | 2014-10-21 03:12:59 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-10-28 12:06:40 -0400 |
commit | d9b53c3c4ce0657000cad1efbbcd95fdd699a7b6 (patch) | |
tree | c75881383af11ea99001066b64cd8aafbf2dd9c8 | |
parent | 65fdc966c012b62ce4da5bf8175140a9b2ec2ee7 (diff) |
gpio: gpio-stp-xway: remove duplicate check on resource
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-stp-xway.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c index 7e359b7cce1b..7892e0fa8ba7 100644 --- a/drivers/gpio/gpio-stp-xway.c +++ b/drivers/gpio/gpio-stp-xway.c | |||
@@ -199,21 +199,17 @@ static int xway_stp_hw_init(struct xway_stp *chip) | |||
199 | 199 | ||
200 | static int xway_stp_probe(struct platform_device *pdev) | 200 | static int xway_stp_probe(struct platform_device *pdev) |
201 | { | 201 | { |
202 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 202 | struct resource *res; |
203 | const __be32 *shadow, *groups, *dsl, *phy; | 203 | const __be32 *shadow, *groups, *dsl, *phy; |
204 | struct xway_stp *chip; | 204 | struct xway_stp *chip; |
205 | struct clk *clk; | 205 | struct clk *clk; |
206 | int ret = 0; | 206 | int ret = 0; |
207 | 207 | ||
208 | if (!res) { | ||
209 | dev_err(&pdev->dev, "failed to request STP resource\n"); | ||
210 | return -ENOENT; | ||
211 | } | ||
212 | |||
213 | chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); | 208 | chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); |
214 | if (!chip) | 209 | if (!chip) |
215 | return -ENOMEM; | 210 | return -ENOMEM; |
216 | 211 | ||
212 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
217 | chip->virt = devm_ioremap_resource(&pdev->dev, res); | 213 | chip->virt = devm_ioremap_resource(&pdev->dev, res); |
218 | if (IS_ERR(chip->virt)) | 214 | if (IS_ERR(chip->virt)) |
219 | return PTR_ERR(chip->virt); | 215 | return PTR_ERR(chip->virt); |