Skip to content

Commit fecd883

Browse files
andy-shevmchehab
authored andcommitted
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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent c30f4cb commit fecd883

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -514,19 +514,14 @@ static int gmin_detect_pmic(struct v4l2_subdev *subdev)
514514
static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev)
515515
{
516516
struct i2c_client *client = v4l2_get_subdevdata(subdev);
517+
struct device *dev = &client->dev;
517518
struct acpi_device *adev;
518519
struct gmin_subdev *gs;
519520
acpi_handle handle;
520-
struct device *dev;
521521
int i, ret, clock_num = -1;
522522

523-
if (!client)
524-
return NULL;
525-
526-
dev = &client->dev;
527-
528523
handle = ACPI_HANDLE(dev);
529-
adev = ACPI_COMPANION(&client->dev);
524+
adev = ACPI_COMPANION(dev);
530525

531526
dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n",
532527
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
@@ -829,12 +824,8 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
829824
{
830825
struct gmin_subdev *gs = find_gmin_subdev(subdev);
831826
int ret;
832-
struct device *dev;
833-
struct i2c_client *client = v4l2_get_subdevdata(subdev);
834827
int value;
835828

836-
dev = &client->dev;
837-
838829
if (gs->v1p8_gpio >= 0) {
839830
pr_info("atomisp_gmin_platform: 1.8v power on GPIO %d\n",
840831
gs->v1p8_gpio);
@@ -887,12 +878,8 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on)
887878
{
888879
struct gmin_subdev *gs = find_gmin_subdev(subdev);
889880
int ret;
890-
struct device *dev;
891-
struct i2c_client *client = v4l2_get_subdevdata(subdev);
892881
int value;
893882

894-
dev = &client->dev;
895-
896883
if (gs->v2p8_gpio >= 0) {
897884
pr_info("atomisp_gmin_platform: 2.8v power on GPIO %d\n",
898885
gs->v2p8_gpio);

0 commit comments

Comments
 (0)