|
@@ -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;
|