* thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name()
@ 2008-10-30 1:38 Kay Sievers
2008-11-03 14:54 ` Henrique de Moraes Holschuh
0 siblings, 1 reply; 4+ messages in thread
From: Kay Sievers @ 2008-10-30 1:38 UTC (permalink / raw)
To: Henrique de Moraes Holschuh; +Cc: linux-kernel, Greg KH
This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".
To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.
We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.
We want to submit a patch to -next, which will remove bus_id from
"struct device", to find the remaining pieces to convert, and finally
switch over to the new api, which will remove the 20 bytes array
and does no longer have a size limitation.
Thanks,
Kay
From: Kay Sievers <kay.sievers@vrfy.org>
Subject: thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name()
CC: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
---
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 4db1cf9..46a06e1 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -2376,7 +2376,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
/* forward it to userspace, maybe it knows how to handle it */
acpi_bus_generate_netlink_event(
ibm->acpi->device->pnp.device_class,
- ibm->acpi->device->dev.bus_id,
+ dev_name(&ibm->acpi->device->dev),
event, 0);
return;
}
@@ -2506,7 +2506,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
if (!ignore_acpi_ev && send_acpi_ev) {
acpi_bus_generate_netlink_event(
ibm->acpi->device->pnp.device_class,
- ibm->acpi->device->dev.bus_id,
+ dev_name(&ibm->acpi->device->dev),
event, hkey);
}
}
@@ -3725,7 +3725,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
}
acpi_bus_generate_proc_event(ibm->acpi->device, event, data);
acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
- ibm->acpi->device->dev.bus_id,
+ dev_name(&ibm->acpi->device->dev),
event, data);
}
@@ -3827,7 +3827,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event)
{
acpi_bus_generate_proc_event(ibm->acpi->device, event, 0);
acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
- ibm->acpi->device->dev.bus_id,
+ dev_name(&ibm->acpi->device->dev),
event, 0);
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name()
2008-10-30 1:38 thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name() Kay Sievers
@ 2008-11-03 14:54 ` Henrique de Moraes Holschuh
2008-11-03 15:14 ` Kay Sievers
0 siblings, 1 reply; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-11-03 14:54 UTC (permalink / raw)
To: Kay Sievers; +Cc: linux-kernel, Greg KH
On Thu, 30 Oct 2008, Kay Sievers wrote:
> From: Kay Sievers <kay.sievers@vrfy.org>
> Subject: thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name()
>
> CC: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Do you want me to push it to Len for merge through the acpi tree, or are
you guys going to be handle it through another tree?
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name()
2008-11-03 14:54 ` Henrique de Moraes Holschuh
@ 2008-11-03 15:14 ` Kay Sievers
2008-11-03 15:26 ` Henrique de Moraes Holschuh
0 siblings, 1 reply; 4+ messages in thread
From: Kay Sievers @ 2008-11-03 15:14 UTC (permalink / raw)
To: Henrique de Moraes Holschuh; +Cc: linux-kernel, Greg KH
On Mon, Nov 3, 2008 at 15:54, Henrique de Moraes Holschuh
<hmh@hmh.eng.br> wrote:
> On Thu, 30 Oct 2008, Kay Sievers wrote:
>> From: Kay Sievers <kay.sievers@vrfy.org>
>> Subject: thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name()
>>
>> CC: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
>> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
>> Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
>
> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
>
> Do you want me to push it to Len for merge through the acpi tree, or are
> you guys going to be handle it through another tree?
Would be nice if you can push it and it will show up in -next soon, so
we can check there what's still missing.
Thanks,
Kay
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name()
2008-11-03 15:14 ` Kay Sievers
@ 2008-11-03 15:26 ` Henrique de Moraes Holschuh
0 siblings, 0 replies; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-11-03 15:26 UTC (permalink / raw)
To: Kay Sievers; +Cc: linux-kernel, Greg KH
On Mon, 03 Nov 2008, Kay Sievers wrote:
> On Mon, Nov 3, 2008 at 15:54, Henrique de Moraes Holschuh
> <hmh@hmh.eng.br> wrote:
> > On Thu, 30 Oct 2008, Kay Sievers wrote:
> >> From: Kay Sievers <kay.sievers@vrfy.org>
> >> Subject: thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name()
> >>
> >> CC: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> >> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
> >> Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
> >
> > Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> >
> > Do you want me to push it to Len for merge through the acpi tree, or are
> > you guys going to be handle it through another tree?
>
> Would be nice if you can push it and it will show up in -next soon, so
> we can check there what's still missing.
I will push it to Len, but it depends on him when it will hit -next.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-11-03 15:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-30 1:38 thinkpad_acpi: struct device - replace bus_id with dev_name(), dev_set_name() Kay Sievers
2008-11-03 14:54 ` Henrique de Moraes Holschuh
2008-11-03 15:14 ` Kay Sievers
2008-11-03 15:26 ` Henrique de Moraes Holschuh
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®