public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Couple of sysfs patches
@ 2004-06-09  7:21 Dmitry Torokhov
  2004-06-09  7:22 ` [PATCH 1/3] whitespace fixes in drivers/base Dmitry Torokhov
  2004-06-09 22:13 ` [PATCH 0/3] Couple of sysfs patches Greg KH
  0 siblings, 2 replies; 28+ messages in thread
From: Dmitry Torokhov @ 2004-06-09  7:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg KH

Hi,

I am trying to add sysfs support to the serio subsystem and I would like you
to consider the following changes:
 
- when registering platform device, if device id is set to -1, do not add it
  as a suffix to device's name. It can be used when there is only one device.
  The reason for change - i find that i80420 looks ugly, just i8042 is much
  better ;)

- create platform_device_simple_releasse function that would just free memory
  occupied by platform device. Having such release routine in core allows
  drivers implementing simple platform devices not wait in module unload code
  till last reference to the device is dropped.

And of course whitespace changes ;) in the very first patch.

Please consider applying.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 0/3] Couple of sysfs patches
@ 2004-06-10 14:46 Dmitry Torokhov
  2004-06-10 16:06 ` Russell King
  0 siblings, 1 reply; 28+ messages in thread
From: Dmitry Torokhov @ 2004-06-10 14:46 UTC (permalink / raw)
  To: Russell King; +Cc: Greg KH, linux-kernel

Russell King wrote:
> On Thu, Jun 10, 2004 at 07:55:59AM -0500, Dmitry Torokhov wrote:
> > On Thursday 10 June 2004 05:16 am, Russell King wrote:
> > >
> > > As this currently stands, you have no chance to add resources to the
> > > platform device before it's made available to the driver.  It's likely
> > > that any attached resources will have the same lifetime as the
> > > device itself, so it makes sense to allocate them together with the
> > > platform device.
> > >
> >
> > Are you suggesting adding pointer to resources as a 3rd argument and
> > automotically release it for the user? It probably could be done but users
> > will be tempted to use static module data and bad things would happen.
> 
> Please read my second sentence again.  It implies a copy of the resources
> is kept with the platform device, so both have the same lifetime.
> 

Ok, so function pointer to allocate resources and associate with the
device? You can't just allocate memory for resources structure, you
need to populate it with data if you want it to be used by a driver
immediately after registration... And have actually release all
resources, not only memory? It is getting beyond the "*_simple"
approach though.

Or do I still misunderstand you?

--
Dmitry



^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 0/3] Couple of sysfs patches
@ 2004-06-18 19:59 Dmitry Torokhov
  0 siblings, 0 replies; 28+ messages in thread
From: Dmitry Torokhov @ 2004-06-18 19:59 UTC (permalink / raw)
  To: Russell King; +Cc: Greg KH

Russell King wrote:
>  void platform_device_unregister(struct platform_device * pdev)
>  {
> -	if (pdev)
> +	int i;
> +
> +	if (pdev) {
>  		device_unregister(&pdev->dev);
> +
> +		for (i = 0; i < pdev->num_resources; i++) {
> +			struct resource *r = &pdev->resource[i];
> +			if (r->flags & (IORESOURCE_MEM|IORESOURCE_IO))
> +				release_resource(r);
> +		}
> +	}
>  }

Ok, now it's possibly just a nitpicking but would not it be "more correct"
if allocated resources were freed in reverse order?

--
Dmitry

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2004-06-18 20:47 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-09  7:21 [PATCH 0/3] Couple of sysfs patches Dmitry Torokhov
2004-06-09  7:22 ` [PATCH 1/3] whitespace fixes in drivers/base Dmitry Torokhov
2004-06-09  7:24   ` [PATCH 2/3] Suppress platform device suffixes Dmitry Torokhov
2004-06-09  7:25     ` [PATCH 3/3] Add platform_device_simple_release Dmitry Torokhov
2004-06-09 22:13 ` [PATCH 0/3] Couple of sysfs patches Greg KH
     [not found]   ` <200406091732.28684.dtor_core@ameritech.net>
2004-06-09 22:45     ` Greg KH
     [not found]       ` <200406091754.23303.dtor_core@ameritech.net>
2004-06-09 23:19         ` Greg KH
2004-06-10  6:40           ` Dmitry Torokhov
2004-06-10  6:42             ` [PATCH 1/3] Suppress platform device suffixes - take 2 Dmitry Torokhov
2004-06-10  6:43               ` [PATCH 2/3] Add platform_device_register_simple Dmitry Torokhov
2004-06-10  6:44                 ` [PATCH 3/3] Whitespace fixes Dmitry Torokhov
2004-06-10  6:46                   ` [PATCH 4/3] Allow registering device without taking bus lock Dmitry Torokhov
2004-06-10 10:14                     ` Russell King
2004-06-10 16:02                     ` Greg KH
2004-06-10 16:26                   ` [PATCH 3/3] Whitespace fixes Greg KH
2004-06-10 10:16                 ` [PATCH 2/3] Add platform_device_register_simple Russell King
     [not found]                   ` <200406100755.59943.dtor_core@ameritech.net>
2004-06-10 13:56                     ` Russell King
2004-06-10 16:04                 ` Greg KH
2004-06-10 16:19               ` [PATCH 1/3] Suppress platform device suffixes - take 2 Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2004-06-10 14:46 [PATCH 0/3] Couple of sysfs patches Dmitry Torokhov
2004-06-10 16:06 ` Russell King
2004-06-10 16:14   ` Greg KH
2004-06-10 18:17     ` Russell King
2004-06-10 20:25       ` Russell King
2004-06-16 22:51         ` Dmitry Torokhov
2004-06-18 19:29           ` Russell King
2004-06-18 20:39             ` Greg KH
2004-06-18 19:59 Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox