lkml.org 
[lkml]   [2014]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V5 02/12] PNPACPI: use whilte list for pnpacpi device enumeration
From
Date
On Mon, 2014-04-28 at 00:01 +0200, Rafael J. Wysocki wrote:
> On Tuesday, April 08, 2014 12:06:49 AM Zhang Rui wrote:
>
> [...]
>
> > +
> > +static int acpi_pnp_scan_handler_attach(struct acpi_device *adev,
> > + const struct acpi_device_id *id)
> > +{
> > + return 1;
> > +}
> > +
> > +static int acpi_pnp_scan_handler_match(char *devid, char *handlerid)
> > +{
> > + int i;
> > +
> > + if (memcmp(devid, handlerid, 3))
> > + return 0;
> > +
> > + for (i = 3; i < 7; i++) {
> > + /* Not a HEX value */
> > + if (!((devid[i] >= '0' && devid[i] <= '9') ||
> > + (devid[i] > 'A' && devid[i] <= 'F')))
> > + return 0;
> > +
> > + if ((handlerid[i] != 'X') &&
>
> Hmm. What exactly is the above check for?
>
PNP bus supports wildcard in the drivers' id list.
say, drivers/tty/serial/8250/8250_pnp.c
{"WACFXXX"}, /* Wacom tablets */
means the driver wants to try to probe all the PNP devices start with
"WACF".

thanks,
rui
> > + toupper(devid[i]) != toupper(handlerid[i]))
> > + return 0;
> > + }
> > + return 1;
> > +}
> > +
> > +static struct acpi_scan_handler acpi_pnp_handler = {
> > + .ids = acpi_pnp_device_ids,
> > + .match = acpi_pnp_scan_handler_match,
> > + .attach = acpi_pnp_scan_handler_attach,
> > +};
> > +
> > +bool acpi_is_pnp_device(struct acpi_device *device)
> > +{
> > + return device->handler == &acpi_pnp_handler;
> > +}
> > +EXPORT_SYMBOL_GPL(acpi_is_pnp_device);
> > +
> > +void __init acpi_pnp_init(void)
> > +{
> > + acpi_scan_add_handler(&acpi_pnp_handler);
> > +}
> > diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
>
>




\
 
 \ /
  Last update: 2014-04-28 04:21    [W:0.183 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site