summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/i2c-multi-instantiate.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-11-05 13:05:28 +0200
committerHans de Goede <hdegoede@redhat.com>2020-11-24 11:25:19 +0100
commita9d1c25004820b1fa7dcd99626ad5c73e023fb6d (patch)
treef35032fbe6de68a7662998c90dd92d4b3bd0dcec /drivers/platform/x86/i2c-multi-instantiate.c
parent6c328c347ac3dae3c89c2610bc3d0a3ac8574e07 (diff)
downloadlinux-a9d1c25004820b1fa7dcd99626ad5c73e023fb6d.tar.bz2
platform/x86: i2c-multi-instantiate: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20201105110530.27888-2-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/i2c-multi-instantiate.c')
-rw-r--r--drivers/platform/x86/i2c-multi-instantiate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index d92d9a98ec8f..ce4d921c3301 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -118,9 +118,8 @@ static int i2c_multi_inst_probe(struct platform_device *pdev)
}
multi->clients[i] = i2c_acpi_new_device(dev, i, &board_info);
if (IS_ERR(multi->clients[i])) {
- ret = PTR_ERR(multi->clients[i]);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "Error creating i2c-client, idx %d\n", i);
+ ret = dev_err_probe(dev, PTR_ERR(multi->clients[i]),
+ "Error creating i2c-client, idx %d\n", i);
goto error;
}
}