Commit f7747be1 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jani Nikula

drm/i915/dsi: Drop double check ACPI companion device for NULL

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211222154033.6770-1-andriy.shevchenko@linux.intel.com
parent 798c5daf
...@@ -426,24 +426,16 @@ static void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi, ...@@ -426,24 +426,16 @@ static void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
const u16 slave_addr) const u16 slave_addr)
{ {
struct drm_device *drm_dev = intel_dsi->base.base.dev; struct drm_device *drm_dev = intel_dsi->base.base.dev;
struct device *dev = drm_dev->dev; struct acpi_device *adev = ACPI_COMPANION(drm_dev->dev);
struct acpi_device *acpi_dev; struct i2c_adapter_lookup lookup = {
struct list_head resource_list; .slave_addr = slave_addr,
struct i2c_adapter_lookup lookup; .intel_dsi = intel_dsi,
.dev_handle = acpi_device_handle(adev),
acpi_dev = ACPI_COMPANION(dev); };
if (acpi_dev) { LIST_HEAD(resource_list);
memset(&lookup, 0, sizeof(lookup));
lookup.slave_addr = slave_addr; acpi_dev_get_resources(adev, &resource_list, i2c_adapter_lookup, &lookup);
lookup.intel_dsi = intel_dsi; acpi_dev_free_resource_list(&resource_list);
lookup.dev_handle = acpi_device_handle(acpi_dev);
INIT_LIST_HEAD(&resource_list);
acpi_dev_get_resources(acpi_dev, &resource_list,
i2c_adapter_lookup,
&lookup);
acpi_dev_free_resource_list(&resource_list);
}
} }
#else #else
static inline void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi, static inline void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment