From: Greg KH <greg@kroah.com>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] Couple of sysfs patches
Date: Wed, 9 Jun 2004 16:19:20 -0700 [thread overview]
Message-ID: <20040609231920.GA9132@kroah.com> (raw)
In-Reply-To: <200406091754.23303.dtor_core@ameritech.net>
On Wed, Jun 09, 2004 at 05:54:23PM -0500, Dmitry Torokhov wrote:
> On Wednesday 09 June 2004 05:45 pm, Greg KH wrote:
> > On Wed, Jun 09, 2004 at 05:32:28PM -0500, Dmitry Torokhov wrote:
> > > Actually, I myself want someting else -
> > >
> > > int platform_device_register_simple(struct platform_device **ppdev,
> > > const char *name, int id)
> > >
> > > It will allocate platform device, set name and id and release function to
> > > platform_device_simple_release which in turn will be hidden from outside
> > > world. Since the function does allocation for user is should prevent the
> > > abuse you were concerned about.
> >
> > Ok, that sounds good. I'll take patches for that kind of interface.
> >
> > But have the function return the pointer, like the class_simple
> > functions work. Not the ** like you just specified.
>
> I want to do both allocation + registration in one shot and I knowing
> the error code may be important to users.
That's fine to do. Again, look at how the class_simple_create()
function works. If an error happens, convert it to ERR_PTR() and return
that. The caller can check it with IS_ERR() and friends.
> Why do you oppose having double pointers in interface?
It's messy, and with the ERR_PTR() macros, not needed :)
thanks,
greg k-h
next prev parent reply other threads:[~2004-06-09 23:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=20040609231920.GA9132@kroah.com \
--to=greg@kroah.com \
--cc=dtor_core@ameritech.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.