All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
To: <vivek.kasireddy@intel.com>, <matthew.d.roper@intel.com>,
	<zhangxiaoxu5@huawei.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/i915/dsi: Fix implicit declaration of function 'acpi_dev*' in 'mipi_exec_i2c'
Date: Mon, 13 Jan 2020 18:55:39 +0800	[thread overview]
Message-ID: <20200113105539.9493-1-zhangxiaoxu5@huawei.com> (raw)

If no 'CONFIG_ACPI' configured, shouldn't call 'acpi_device_handle',
'acpi_dev_get_resources' and 'acpi_dev_free_resource_list' in function
'mipi_exec_i2c'.

Fixes: 8cbf89db2941("drm/i915/dsi: Parse the I2C element from the VBT MIPI sequence block (v3)")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
---
 drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
index 89fb0d90b694..73a25e7ae090 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
@@ -384,6 +384,7 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
 	return data;
 }
 
+#ifdef CONFIG_ACPI
 static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
 {
 	struct i2c_adapter_lookup *lookup = data;
@@ -399,7 +400,6 @@ static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
 
 	if (lookup->slave_addr != sb->slave_address)
 		return 1;
-
 	status = acpi_get_handle(lookup->dev_handle,
 				 sb->resource_source.string_ptr,
 				 &adapter_handle);
@@ -412,15 +412,13 @@ static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
 
 	return 1;
 }
+#endif
 
 static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 {
 	struct drm_device *drm_dev = intel_dsi->base.base.dev;
 	struct device *dev = &drm_dev->pdev->dev;
 	struct i2c_adapter *adapter;
-	struct acpi_device *acpi_dev;
-	struct list_head resource_list;
-	struct i2c_adapter_lookup lookup;
 	struct i2c_msg msg;
 	int ret;
 	u8 vbt_i2c_bus_num = *(data + 2);
@@ -430,8 +428,13 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 	u8 *payload_data;
 
 	if (intel_dsi->i2c_bus_num < 0) {
+#ifdef CONFIG_ACPI
+		struct acpi_device *acpi_dev;
+		struct list_head resource_list;
+		struct i2c_adapter_lookup lookup;
+#endif
 		intel_dsi->i2c_bus_num = vbt_i2c_bus_num;
-
+#ifdef CONFIG_ACPI
 		acpi_dev = ACPI_COMPANION(dev);
 		if (acpi_dev) {
 			memset(&lookup, 0, sizeof(lookup));
@@ -445,6 +448,7 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 					       &lookup);
 			acpi_dev_free_resource_list(&resource_list);
 		}
+#endif
 	}
 
 	adapter = i2c_get_adapter(intel_dsi->i2c_bus_num);
-- 
2.17.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
To: <vivek.kasireddy@intel.com>, <matthew.d.roper@intel.com>,
	<zhangxiaoxu5@huawei.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] drm/i915/dsi: Fix implicit declaration of function 'acpi_dev*' in 'mipi_exec_i2c'
Date: Mon, 13 Jan 2020 18:55:39 +0800	[thread overview]
Message-ID: <20200113105539.9493-1-zhangxiaoxu5@huawei.com> (raw)

If no 'CONFIG_ACPI' configured, shouldn't call 'acpi_device_handle',
'acpi_dev_get_resources' and 'acpi_dev_free_resource_list' in function
'mipi_exec_i2c'.

Fixes: 8cbf89db2941("drm/i915/dsi: Parse the I2C element from the VBT MIPI sequence block (v3)")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
---
 drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
index 89fb0d90b694..73a25e7ae090 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
@@ -384,6 +384,7 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
 	return data;
 }
 
+#ifdef CONFIG_ACPI
 static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
 {
 	struct i2c_adapter_lookup *lookup = data;
@@ -399,7 +400,6 @@ static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
 
 	if (lookup->slave_addr != sb->slave_address)
 		return 1;
-
 	status = acpi_get_handle(lookup->dev_handle,
 				 sb->resource_source.string_ptr,
 				 &adapter_handle);
@@ -412,15 +412,13 @@ static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
 
 	return 1;
 }
+#endif
 
 static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 {
 	struct drm_device *drm_dev = intel_dsi->base.base.dev;
 	struct device *dev = &drm_dev->pdev->dev;
 	struct i2c_adapter *adapter;
-	struct acpi_device *acpi_dev;
-	struct list_head resource_list;
-	struct i2c_adapter_lookup lookup;
 	struct i2c_msg msg;
 	int ret;
 	u8 vbt_i2c_bus_num = *(data + 2);
@@ -430,8 +428,13 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 	u8 *payload_data;
 
 	if (intel_dsi->i2c_bus_num < 0) {
+#ifdef CONFIG_ACPI
+		struct acpi_device *acpi_dev;
+		struct list_head resource_list;
+		struct i2c_adapter_lookup lookup;
+#endif
 		intel_dsi->i2c_bus_num = vbt_i2c_bus_num;
-
+#ifdef CONFIG_ACPI
 		acpi_dev = ACPI_COMPANION(dev);
 		if (acpi_dev) {
 			memset(&lookup, 0, sizeof(lookup));
@@ -445,6 +448,7 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 					       &lookup);
 			acpi_dev_free_resource_list(&resource_list);
 		}
+#endif
 	}
 
 	adapter = i2c_get_adapter(intel_dsi->i2c_bus_num);
-- 
2.17.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2020-01-14  8:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 10:55 Zhang Xiaoxu [this message]
2020-01-13 10:55 ` [Intel-gfx] [PATCH] drm/i915/dsi: Fix implicit declaration of function 'acpi_dev*' in 'mipi_exec_i2c' Zhang Xiaoxu
2020-01-13 20:02 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-01-13 20:02 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-01-15 20:34 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200113105539.9493-1-zhangxiaoxu5@huawei.com \
    --to=zhangxiaoxu5@huawei.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=vivek.kasireddy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.