Skip to content

Commit e8b4a89

Browse files
andy-shevmchehab
authored andcommitted
media: atomisp: Get rid of ACPI specifics in gmin_subdev_add()
First of all ACPI HID is a part of the device name which is printed as a part of the dev_info(dev, ...); line. Second, since the only BID is left, it's a part of ACPI path, which can be printed via %pfw. Besides that, drop ACPI handle from atomisp_get_acpi_power() parameters. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 5cb30ae commit e8b4a89

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,13 @@ static int gmin_i2c_write(struct device *dev, u16 i2c_addr, u8 reg,
423423
return ret;
424424
}
425425

426-
static int atomisp_get_acpi_power(struct device *dev, acpi_handle handle)
426+
static int atomisp_get_acpi_power(struct device *dev)
427427
{
428428
char name[5];
429429
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
430430
struct acpi_buffer b_name = { sizeof(name), name };
431431
union acpi_object *package, *element;
432+
acpi_handle handle = ACPI_HANDLE(dev);
432433
acpi_handle rhandle;
433434
acpi_status status;
434435
int clock_num = -1;
@@ -515,15 +516,10 @@ static int gmin_subdev_add(struct gmin_subdev *gs)
515516
{
516517
struct i2c_client *client = v4l2_get_subdevdata(gs->subdev);
517518
struct device *dev = &client->dev;
518-
struct acpi_device *adev;
519-
acpi_handle handle;
519+
struct acpi_device *adev = ACPI_COMPANION(dev);
520520
int ret, clock_num = -1;
521521

522-
handle = ACPI_HANDLE(dev);
523-
adev = ACPI_COMPANION(dev);
524-
525-
dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n",
526-
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
522+
dev_info(dev, "%s: ACPI path is %pfw\n", __func__, dev_fwnode(dev));
527523

528524
/*WA:CHT requires XTAL clock as PLL is not stable.*/
529525
gs->clock_src = gmin_get_var_int(dev, false, "ClkSrc",
@@ -612,7 +608,7 @@ static int gmin_subdev_add(struct gmin_subdev *gs)
612608

613609
/* Try first to use ACPI to get the clock resource */
614610
if (acpi_device_power_manageable(adev))
615-
clock_num = atomisp_get_acpi_power(dev, handle);
611+
clock_num = atomisp_get_acpi_power(dev);
616612

617613
/* Fall-back use EFI and/or DMI match */
618614
if (clock_num < 0)

0 commit comments

Comments
 (0)