diff mbox

[2/5] eeepc-wmi: Use acpi_dev_present

Message ID bdff67293ead344ccec77f55437085561b1ad88d.1448282995.git.lukas@wunner.de (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Lukas Wunner Nov. 23, 2015, 2:34 p.m. UTC
Use shiny new acpi_dev_present and remove all the boilerplate to search
for a particular ACPI device. No functional change.

Cc: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
 drivers/platform/x86/eeepc-wmi.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

Comments

Darren Hart Nov. 23, 2015, 7:04 p.m. UTC | #1
On Mon, Nov 23, 2015 at 03:34:55PM +0100, Lukas Wunner wrote:
> Use shiny new acpi_dev_present and remove all the boilerplate to search
> for a particular ACPI device. No functional change.

You did add a pr_warn, which is technically a functional change. Did you intend
to leave that in?

I have no objection for platform-drivers-x86, but please include all maintainers
listed by get_maintainer.pl for the fastest response.

+Rafael

Rafael, I assume you will pick this up along with the acpi_dev_present ACPI
change if you take that. Pleaes let me know if not.

Otherwise,

Acked-by: Darren Hart <dvhart@linux.intel.com>
Lukas Wunner Nov. 23, 2015, 7:55 p.m. UTC | #2
Hi Darren,

On Mon, Nov 23, 2015 at 11:04:13AM -0800, Darren Hart wrote:
> On Mon, Nov 23, 2015 at 03:34:55PM +0100, Lukas Wunner wrote:
> > Use shiny new acpi_dev_present and remove all the boilerplate to search
> > for a particular ACPI device. No functional change.
> 
> You did add a pr_warn, which is technically a functional change. Did you intend
> to leave that in?

That's not an addition of mine, I moved it from eeepc_wmi_parse_device()
to eeepc_wmi_probe() so that everything behaves exactly as before.
(See the deleted lines further up in the patch.)


> Rafael, I assume you will pick this up along with the acpi_dev_present ACPI
> change if you take that. Pleaes let me know if not.

The last patch in the series concerned Intel ASoC (sound/soc/intel/)
and the maintainer Mark Brown <broonie@kernel.org> has replied that
"This will collide with some other work done on the Intel code in -next I
expect, probably best to merge this via ASoC (so pulling a shared branch
for the new API) or just wait till 4.5 to do the conversion."
[full quote of his message as it wasn't cc: platform-driver-x86]

So I guess Mark might pull it in, haven't heard back from the ACPI
maintainers yet.


> Otherwise,
> Acked-by: Darren Hart <dvhart@linux.intel.com>

Awesome, thanks!

Best regards,

Lukas
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darren Hart Nov. 23, 2015, 9 p.m. UTC | #3
On Mon, Nov 23, 2015 at 08:55:27PM +0100, Lukas Wunner wrote:
> Hi Darren,
> 
> On Mon, Nov 23, 2015 at 11:04:13AM -0800, Darren Hart wrote:
> > On Mon, Nov 23, 2015 at 03:34:55PM +0100, Lukas Wunner wrote:
> > > Use shiny new acpi_dev_present and remove all the boilerplate to search
> > > for a particular ACPI device. No functional change.
> > 
> > You did add a pr_warn, which is technically a functional change. Did you intend
> > to leave that in?
> 
> That's not an addition of mine, I moved it from eeepc_wmi_parse_device()
> to eeepc_wmi_probe() so that everything behaves exactly as before.
> (See the deleted lines further up in the patch.)

Ah, apologies.

> 
> 
> > Rafael, I assume you will pick this up along with the acpi_dev_present ACPI
> > change if you take that. Pleaes let me know if not.
> 
> The last patch in the series concerned Intel ASoC (sound/soc/intel/)
> and the maintainer Mark Brown <broonie@kernel.org> has replied that
> "This will collide with some other work done on the Intel code in -next I
> expect, probably best to merge this via ASoC (so pulling a shared branch
> for the new API) or just wait till 4.5 to do the conversion."
> [full quote of his message as it wasn't cc: platform-driver-x86]
> 
> So I guess Mark might pull it in, haven't heard back from the ACPI
> maintainers yet.
> 

I'll defer to Rafael's preference here.
Rafael J. Wysocki Nov. 23, 2015, 10:35 p.m. UTC | #4
On Monday, November 23, 2015 11:04:13 AM Darren Hart wrote:
> On Mon, Nov 23, 2015 at 03:34:55PM +0100, Lukas Wunner wrote:
> > Use shiny new acpi_dev_present and remove all the boilerplate to search
> > for a particular ACPI device. No functional change.
> 
> You did add a pr_warn, which is technically a functional change. Did you intend
> to leave that in?
> 
> I have no objection for platform-drivers-x86, but please include all maintainers
> listed by get_maintainer.pl for the fastest response.
> 
> +Rafael
> 
> Rafael, I assume you will pick this up along with the acpi_dev_present ACPI
> change if you take that. Pleaes let me know if not.
> 
> Otherwise,
> 
> Acked-by: Darren Hart <dvhart@linux.intel.com>

In fact, patch [1/5] as is needs to go in through upstream ACPICA, so I'm not
taking this series and please don't take it too.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darren Hart Nov. 24, 2015, 5:08 p.m. UTC | #5
On Mon, Nov 23, 2015 at 11:35:55PM +0100, Rafael Wysocki wrote:
> On Monday, November 23, 2015 11:04:13 AM Darren Hart wrote:
> > On Mon, Nov 23, 2015 at 03:34:55PM +0100, Lukas Wunner wrote:
> > > Use shiny new acpi_dev_present and remove all the boilerplate to search
> > > for a particular ACPI device. No functional change.
> > 
> > You did add a pr_warn, which is technically a functional change. Did you intend
> > to leave that in?
> > 
> > I have no objection for platform-drivers-x86, but please include all maintainers
> > listed by get_maintainer.pl for the fastest response.
> > 
> > +Rafael
> > 
> > Rafael, I assume you will pick this up along with the acpi_dev_present ACPI
> > change if you take that. Pleaes let me know if not.
> > 
> > Otherwise,
> > 
> > Acked-by: Darren Hart <dvhart@linux.intel.com>
> 
> In fact, patch [1/5] as is needs to go in through upstream ACPICA, so I'm not
> taking this series and please don't take it too.

Ah, thanks, my mistake.
diff mbox

Patch

diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 14fd2ec..e1490db 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -204,30 +204,10 @@  static void eeepc_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int *code,
 	}
 }
 
-static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level,
-						 void *context, void **retval)
-{
-	pr_warn("Found legacy ATKD device (%s)\n", EEEPC_ACPI_HID);
-	*(bool *)context = true;
-	return AE_CTRL_TERMINATE;
-}
-
-static int eeepc_wmi_check_atkd(void)
-{
-	acpi_status status;
-	bool found = false;
-
-	status = acpi_get_devices(EEEPC_ACPI_HID, eeepc_wmi_parse_device,
-				  &found, NULL);
-
-	if (ACPI_FAILURE(status) || !found)
-		return 0;
-	return -1;
-}
-
 static int eeepc_wmi_probe(struct platform_device *pdev)
 {
-	if (eeepc_wmi_check_atkd()) {
+	if (acpi_dev_present(EEEPC_ACPI_HID)) {
+		pr_warn("Found legacy ATKD device (%s)\n", EEEPC_ACPI_HID);
 		pr_warn("WMI device present, but legacy ATKD device is also "
 			"present and enabled\n");
 		pr_warn("You probably booted with acpi_osi=\"Linux\" or "