diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-06-29 13:57:36 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-07-18 08:23:54 +0300 |
commit | fecd8833cc480559a50bf2532254c2e4d3a07240 (patch) | |
tree | 39570891936b97b0ff394449e9736fa5f2baadbb /drivers | |
parent | c30f4cb2d4c785b8bd0ea1710af7a542aeca1bbe (diff) | |
download | linux-fecd8833cc480559a50bf2532254c2e4d3a07240.tar.xz |
media: atomisp: Use temporary variable for device in gmin_subdev_add()
Use temporary variable for device in gmin_subdev_add().
While here, drop unused temporary variable for device in other places.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index efd5e92ad7f6..dc34c7e0d845 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -514,19 +514,14 @@ static int gmin_detect_pmic(struct v4l2_subdev *subdev) static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev) { struct i2c_client *client = v4l2_get_subdevdata(subdev); + struct device *dev = &client->dev; struct acpi_device *adev; struct gmin_subdev *gs; acpi_handle handle; - struct device *dev; int i, ret, clock_num = -1; - if (!client) - return NULL; - - dev = &client->dev; - handle = ACPI_HANDLE(dev); - adev = ACPI_COMPANION(&client->dev); + adev = ACPI_COMPANION(dev); dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n", __func__, acpi_device_bid(adev), acpi_device_hid(adev)); @@ -829,12 +824,8 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on) { struct gmin_subdev *gs = find_gmin_subdev(subdev); int ret; - struct device *dev; - struct i2c_client *client = v4l2_get_subdevdata(subdev); int value; - dev = &client->dev; - if (gs->v1p8_gpio >= 0) { pr_info("atomisp_gmin_platform: 1.8v power on GPIO %d\n", gs->v1p8_gpio); @@ -887,12 +878,8 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on) { struct gmin_subdev *gs = find_gmin_subdev(subdev); int ret; - struct device *dev; - struct i2c_client *client = v4l2_get_subdevdata(subdev); int value; - dev = &client->dev; - if (gs->v2p8_gpio >= 0) { pr_info("atomisp_gmin_platform: 2.8v power on GPIO %d\n", gs->v2p8_gpio); |