diff options
-rw-r--r-- | drivers/mfd/sm501.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 4d9aaf9501df..170f9d47c2f9 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c | |||
@@ -1374,31 +1374,31 @@ static int sm501_init_dev(struct sm501_devdata *sm) | |||
1374 | static int sm501_plat_probe(struct platform_device *dev) | 1374 | static int sm501_plat_probe(struct platform_device *dev) |
1375 | { | 1375 | { |
1376 | struct sm501_devdata *sm; | 1376 | struct sm501_devdata *sm; |
1377 | int err; | 1377 | int ret; |
1378 | 1378 | ||
1379 | sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL); | 1379 | sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL); |
1380 | if (sm == NULL) { | 1380 | if (sm == NULL) { |
1381 | dev_err(&dev->dev, "no memory for device data\n"); | 1381 | dev_err(&dev->dev, "no memory for device data\n"); |
1382 | err = -ENOMEM; | 1382 | ret = -ENOMEM; |
1383 | goto err1; | 1383 | goto err1; |
1384 | } | 1384 | } |
1385 | 1385 | ||
1386 | sm->dev = &dev->dev; | 1386 | sm->dev = &dev->dev; |
1387 | sm->pdev_id = dev->id; | 1387 | sm->pdev_id = dev->id; |
1388 | sm->irq = platform_get_irq(dev, 0); | ||
1389 | sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1); | ||
1390 | sm->mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
1391 | sm->platdata = dev->dev.platform_data; | 1388 | sm->platdata = dev->dev.platform_data; |
1392 | 1389 | ||
1393 | if (sm->irq < 0) { | 1390 | ret = platform_get_irq(dev, 0); |
1391 | if (ret < 0) { | ||
1394 | dev_err(&dev->dev, "failed to get irq resource\n"); | 1392 | dev_err(&dev->dev, "failed to get irq resource\n"); |
1395 | err = sm->irq; | ||
1396 | goto err_res; | 1393 | goto err_res; |
1397 | } | 1394 | } |
1395 | sm->irq = ret; | ||
1398 | 1396 | ||
1397 | sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1); | ||
1398 | sm->mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
1399 | if (sm->io_res == NULL || sm->mem_res == NULL) { | 1399 | if (sm->io_res == NULL || sm->mem_res == NULL) { |
1400 | dev_err(&dev->dev, "failed to get IO resource\n"); | 1400 | dev_err(&dev->dev, "failed to get IO resource\n"); |
1401 | err = -ENOENT; | 1401 | ret = -ENOENT; |
1402 | goto err_res; | 1402 | goto err_res; |
1403 | } | 1403 | } |
1404 | 1404 | ||
@@ -1407,7 +1407,7 @@ static int sm501_plat_probe(struct platform_device *dev) | |||
1407 | 1407 | ||
1408 | if (sm->regs_claim == NULL) { | 1408 | if (sm->regs_claim == NULL) { |
1409 | dev_err(&dev->dev, "cannot claim registers\n"); | 1409 | dev_err(&dev->dev, "cannot claim registers\n"); |
1410 | err= -EBUSY; | 1410 | ret = -EBUSY; |
1411 | goto err_res; | 1411 | goto err_res; |
1412 | } | 1412 | } |
1413 | 1413 | ||
@@ -1418,7 +1418,7 @@ static int sm501_plat_probe(struct platform_device *dev) | |||
1418 | 1418 | ||
1419 | if (sm->regs == NULL) { | 1419 | if (sm->regs == NULL) { |
1420 | dev_err(&dev->dev, "cannot remap registers\n"); | 1420 | dev_err(&dev->dev, "cannot remap registers\n"); |
1421 | err = -EIO; | 1421 | ret = -EIO; |
1422 | goto err_claim; | 1422 | goto err_claim; |
1423 | } | 1423 | } |
1424 | 1424 | ||
@@ -1430,7 +1430,7 @@ static int sm501_plat_probe(struct platform_device *dev) | |||
1430 | err_res: | 1430 | err_res: |
1431 | kfree(sm); | 1431 | kfree(sm); |
1432 | err1: | 1432 | err1: |
1433 | return err; | 1433 | return ret; |
1434 | 1434 | ||
1435 | } | 1435 | } |
1436 | 1436 | ||