mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
To: linux-acpi@vger.kernel.org
Cc: don@syst.com.br, len.brown@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] classmate-laptop: use a single MODULE_DEVICE_TABLE to get correct aliases
Date: Mon, 8 Feb 2010 13:12:31 -0200	[thread overview]
Message-ID: <20100208151230.GB1085@holoscopio.com> (raw)
In-Reply-To: <1264201053-14161-1-git-send-email-cascardo@holoscopio.com>

[-- Attachment #1: Type: text/plain, Size: 3500 bytes --]

Hello, Len Brown.

I'd really like this patch below to go into 2.6.33, since it's needed to
load the driver automatically.

Any chance you'd apply it to your tree and send a pull request to Linus?

Regards,
Cascardo.

On Fri, Jan 22, 2010 at 08:57:33PM -0200, Thadeu Lima de Souza Cascardo wrote:
> Instead of a MODULE_DEVICE_TABLE for every acpi_driver ids table, we
> create a table containing all ids to export to get a module alias for
> each one.
> 
> This will fix automatic loading of the driver when one of the ACPI
> devices is not present (like the accelerometer, which is not present in
> some models).
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
> ---
>  drivers/platform/x86/classmate-laptop.c |   31 +++++++++++++++++++++----------
>  1 files changed, 21 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
> index ed90082..8cb20e4 100644
> --- a/drivers/platform/x86/classmate-laptop.c
> +++ b/drivers/platform/x86/classmate-laptop.c
> @@ -34,6 +34,11 @@ struct cmpc_accel {
>  #define CMPC_ACCEL_SENSITIVITY_DEFAULT		5
>  
>  
> +#define CMPC_ACCEL_HID		"ACCE0000"
> +#define CMPC_TABLET_HID		"TBLT0000"
> +#define CMPC_BL_HID		"IPML200"
> +#define CMPC_KEYS_HID		"FnBT0000"
> +
>  /*
>   * Generic input device code.
>   */
> @@ -282,10 +287,9 @@ static int cmpc_accel_remove(struct acpi_device *acpi, int type)
>  }
>  
>  static const struct acpi_device_id cmpc_accel_device_ids[] = {
> -	{"ACCE0000", 0},
> +	{CMPC_ACCEL_HID, 0},
>  	{"", 0}
>  };
> -MODULE_DEVICE_TABLE(acpi, cmpc_accel_device_ids);
>  
>  static struct acpi_driver cmpc_accel_acpi_driver = {
>  	.owner = THIS_MODULE,
> @@ -366,10 +370,9 @@ static int cmpc_tablet_resume(struct acpi_device *acpi)
>  }
>  
>  static const struct acpi_device_id cmpc_tablet_device_ids[] = {
> -	{"TBLT0000", 0},
> +	{CMPC_TABLET_HID, 0},
>  	{"", 0}
>  };
> -MODULE_DEVICE_TABLE(acpi, cmpc_tablet_device_ids);
>  
>  static struct acpi_driver cmpc_tablet_acpi_driver = {
>  	.owner = THIS_MODULE,
> @@ -477,17 +480,16 @@ static int cmpc_bl_remove(struct acpi_device *acpi, int type)
>  	return 0;
>  }
>  
> -static const struct acpi_device_id cmpc_device_ids[] = {
> -	{"IPML200", 0},
> +static const struct acpi_device_id cmpc_bl_device_ids[] = {
> +	{CMPC_BL_HID, 0},
>  	{"", 0}
>  };
> -MODULE_DEVICE_TABLE(acpi, cmpc_device_ids);
>  
>  static struct acpi_driver cmpc_bl_acpi_driver = {
>  	.owner = THIS_MODULE,
>  	.name = "cmpc",
>  	.class = "cmpc",
> -	.ids = cmpc_device_ids,
> +	.ids = cmpc_bl_device_ids,
>  	.ops = {
>  		.add = cmpc_bl_add,
>  		.remove = cmpc_bl_remove
> @@ -540,10 +542,9 @@ static int cmpc_keys_remove(struct acpi_device *acpi, int type)
>  }
>  
>  static const struct acpi_device_id cmpc_keys_device_ids[] = {
> -	{"FnBT0000", 0},
> +	{CMPC_KEYS_HID, 0},
>  	{"", 0}
>  };
> -MODULE_DEVICE_TABLE(acpi, cmpc_keys_device_ids);
>  
>  static struct acpi_driver cmpc_keys_acpi_driver = {
>  	.owner = THIS_MODULE,
> @@ -607,3 +608,13 @@ static void cmpc_exit(void)
>  
>  module_init(cmpc_init);
>  module_exit(cmpc_exit);
> +
> +static const struct acpi_device_id cmpc_device_ids[] = {
> +	{CMPC_ACCEL_HID, 0},
> +	{CMPC_TABLET_HID, 0},
> +	{CMPC_BL_HID, 0},
> +	{CMPC_KEYS_HID, 0},
> +	{"", 0}
> +};
> +
> +MODULE_DEVICE_TABLE(acpi, cmpc_device_ids);
> -- 
> 1.6.6
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

      reply	other threads:[~2010-02-08 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22 22:57 Thadeu Lima de Souza Cascardo
2010-02-08 15:12 ` Thadeu Lima de Souza Cascardo [this message]

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=20100208151230.GB1085@holoscopio.com \
    --to=cascardo@holoscopio.com \
    --cc=don@syst.com.br \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®