Skip to content

Commit

Permalink
platform/x86: intel_cht_int33fe: Drop double check for ACPI companion…
Browse files Browse the repository at this point in the history
… device

acpi_dev_get_resources() does perform the NULL pointer check against
ACPI companion device which is given as function parameter. Thus,
there is no need to duplicate this check in the caller.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
Andy Shevchenko committed Jul 9, 2020
1 parent b3a9e3b commit eca6f17
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/platform/x86/intel_cht_int33fe_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,16 @@ static int cht_int33fe_i2c_res_filter(struct acpi_resource *ares, void *data)

static int cht_int33fe_count_i2c_clients(struct device *dev)
{
struct acpi_device *adev;
struct acpi_device *adev = ACPI_COMPANION(dev);
LIST_HEAD(resource_list);
int count = 0;
int ret;

adev = ACPI_COMPANION(dev);
if (!adev)
return -EINVAL;

acpi_dev_get_resources(adev, &resource_list,
cht_int33fe_i2c_res_filter, &count);

ret = acpi_dev_get_resources(adev, &resource_list,
cht_int33fe_i2c_res_filter, &count);
acpi_dev_free_resource_list(&resource_list);
if (ret < 0)
return ret;

return count;
}
Expand Down

0 comments on commit eca6f17

Please sign in to comment.