Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[cascardo/linux.git] / drivers / i2c / busses / i2c-xlr.c
index a005265..7945b05 100644 (file)
@@ -7,6 +7,7 @@
  * warranty of any kind, whether express or implied.
  */
 
+#include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -225,11 +226,9 @@ static int xlr_i2c_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->iobase = devm_request_and_ioremap(&pdev->dev, res);
-       if (!priv->iobase) {
-               dev_err(&pdev->dev, "devm_request_and_ioremap failed\n");
-               return -EBUSY;
-       }
+       priv->iobase = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(priv->iobase))
+               return PTR_ERR(priv->iobase);
 
        priv->adap.dev.parent = &pdev->dev;
        priv->adap.owner        = THIS_MODULE;
@@ -257,7 +256,6 @@ static int xlr_i2c_remove(struct platform_device *pdev)
 
        priv = platform_get_drvdata(pdev);
        i2c_del_adapter(&priv->adap);
-       platform_set_drvdata(pdev, NULL);
        return 0;
 }