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>
This commit is contained in:
parent
65fdc966c0
commit
d9b53c3c4c
1 changed files with 2 additions and 6 deletions
|
@ -199,21 +199,17 @@ static int xway_stp_hw_init(struct xway_stp *chip)
|
||||||
|
|
||||||
static int xway_stp_probe(struct platform_device *pdev)
|
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;
|
const __be32 *shadow, *groups, *dsl, *phy;
|
||||||
struct xway_stp *chip;
|
struct xway_stp *chip;
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
int ret = 0;
|
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);
|
chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
|
||||||
if (!chip)
|
if (!chip)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
chip->virt = devm_ioremap_resource(&pdev->dev, res);
|
chip->virt = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (IS_ERR(chip->virt))
|
if (IS_ERR(chip->virt))
|
||||||
return PTR_ERR(chip->virt);
|
return PTR_ERR(chip->virt);
|
||||||
|
|
Loading…
Add table
Reference in a new issue