iio: light: cm32181: Clean up the probe function a bit
authorHans de Goede <hdegoede@redhat.com>
Tue, 28 Apr 2020 17:29:17 +0000 (19:29 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 10 May 2020 09:41:30 +0000 (10:41 +0100)
commitb885d0fa6790b8b2c8502dc93fed27ce85e68922
treeb8697737ec587d19c2832858c088600adb9dab1e
parent02cdab2a8d55c85967a4be4a084efa9641c56066
iio: light: cm32181: Clean up the probe function a bit

3 small cleanups to cm32181_probe():

1. Do not log an error when we fail to allocate memory (as a general
rule drivers do not log errors for this as the kernel will already
have complained loudly that it could not alloc the mem).

2. Remove the i2c_set_clientdata() call, we never use i2c_get_clientdata()
or dev_get_drvdata() anywhere.

3. Add a dev helper variable and use it in various places instead of
&client->dev.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/cm32181.c