All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yue Haibing <yuehaibing@huawei.com>
To: <myungjoo.ham@samsung.com>, <cw00.choi@samsung.com>,
	<wens@csie.org>, <hdegoede@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH] extcon: axp288: Fix build err without CONFIG_ACPI
Date: Thu, 4 Apr 2019 18:42:22 +0800	[thread overview]
Message-ID: <20190404104222.23900-1-yuehaibing@huawei.com> (raw)

From: YueHaibing <yuehaibing@huawei.com>

When building CONFIG_ACPI is not set
gcc warn this:

drivers/extcon/extcon-axp288.c: In function 'axp288_extcon_probe':
drivers/extcon/extcon-axp288.c:363:20: error: dereferencing pointer to incomplete type
    put_device(&adev->dev);

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 0cf064db948a ("extcon: axp288: Convert to use acpi_dev_get_first_match_dev()")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/extcon/extcon-axp288.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 50f9402..ed8ac3f 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -333,7 +333,6 @@ static int axp288_extcon_probe(struct platform_device *pdev)
 	struct axp288_extcon_info *info;
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
 	struct device *dev = &pdev->dev;
-	struct acpi_device *adev;
 	int ret, i, pirq;
 
 	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -357,6 +356,8 @@ static int axp288_extcon_probe(struct platform_device *pdev)
 		if (ret)
 			return ret;
 
+#ifdef CONFIG_ACPI
+		struct acpi_device *adev;
 		adev = acpi_dev_get_first_match_dev("INT3496", NULL, -1);
 		if (adev) {
 			info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev));
@@ -365,9 +366,10 @@ static int axp288_extcon_probe(struct platform_device *pdev)
 				return -EPROBE_DEFER;
 
 			dev_info(dev, "controlling USB role\n");
-		} else {
-			dev_info(dev, "controlling USB role based on Vbus presence\n");
 		}
+#else
+		dev_info(dev, "controlling USB role based on Vbus presence\n");
+#endif
 	}
 
 	info->vbus_attach = axp288_get_vbus_attach(info);
-- 
2.7.4



             reply	other threads:[~2019-04-04 10:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 10:42 Yue Haibing [this message]
2019-04-04 11:47 ` [PATCH] extcon: axp288: Fix build err without CONFIG_ACPI Mukesh Ojha
2019-04-04 12:02 ` Hans de Goede
2019-04-04 13:26   ` YueHaibing
2019-04-04 14:17 ` [PATCH v2] extcon: axp288: Add a depends on ACPI to the Kconfig entry Yue Haibing
2019-04-04 14:17   ` Yue Haibing
2019-04-04 14:44   ` Hans de Goede
2019-04-05  5:36   ` Mukesh Ojha
2019-04-11 23:30   ` Chanwoo Choi
2019-04-12  0:59     ` Chanwoo Choi

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=20190404104222.23900-1-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=cw00.choi@samsung.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=wens@csie.org \
    /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.