* Re: [PATCH] fix bogus use of rc = alloc_chrdev_region() [not found] <1307079502-6326-1-git-send-email-jim.cromie@gmail.com> @ 2011-06-10 20:29 ` Jim Cromie 2011-06-10 20:44 ` Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Jim Cromie @ 2011-06-10 20:29 UTC (permalink / raw) To: linux-kernel; +Cc: rpjday, greg can someone pick this up, for this release or next ? On Thu, Jun 2, 2011 at 11:38 PM, Jim Cromie <jim.cromie@gmail.com> wrote: > Robert P.J. Day noticed a bogus assignment: major = rc, after > the call to alloc_chrdev_region() in pc8736x_gpio_init(). > > The code as written expects return-code behavior as for > register_chrdev(), ie on success: rc = reserved-major when > requested-major = 0. But for alloc_chrdev_region(), this isnt the > case. Since its used for debug printing only, just excise the mess. > > Signed-of-by: Jim Cromie <jim.cromie@gmail.com> > Reported-by: Robert P.J. Day <rpjday@crashcourse.ca> > cc: Greg KH <greg@kroah.com. > Signed-off-by: Jim Cromie <jim.cromie@gmail.com> > --- > drivers/char/pc8736x_gpio.c | 5 +---- > 1 files changed, 1 insertions(+), 4 deletions(-) > > diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c > index b304ec0..30d92fe 100644 > --- a/drivers/char/pc8736x_gpio.c > +++ b/drivers/char/pc8736x_gpio.c > @@ -314,10 +314,7 @@ static int __init pc8736x_gpio_init(void) > dev_err(&pdev->dev, "register-chrdev failed: %d\n", rc); > goto undo_request_region; > } > - if (!major) { > - major = rc; > - dev_dbg(&pdev->dev, "got dynamic major %d\n", major); > - } > + dev_dbg(&pdev->dev, "using chardev major %d\n", major); > > pc8736x_init_shadow(); > > -- > 1.7.4.2 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fix bogus use of rc = alloc_chrdev_region() 2011-06-10 20:29 ` [PATCH] fix bogus use of rc = alloc_chrdev_region() Jim Cromie @ 2011-06-10 20:44 ` Greg KH 2011-06-14 14:07 ` Arnd Bergmann 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2011-06-10 20:44 UTC (permalink / raw) To: Jim Cromie, Arnd Bergmann; +Cc: linux-kernel, rpjday On Fri, Jun 10, 2011 at 02:29:42PM -0600, Jim Cromie wrote: > can someone pick this up, > for this release or next ? It was rumored that Arnd wanted to take over drivers/char/. Arnd? > > On Thu, Jun 2, 2011 at 11:38 PM, Jim Cromie <jim.cromie@gmail.com> wrote: > > Robert P.J. Day noticed a bogus assignment: major = rc, after > > the call to alloc_chrdev_region() in pc8736x_gpio_init(). > > > > The code as written expects return-code behavior as for > > register_chrdev(), ie on success: rc = reserved-major when > > requested-major = 0. But for alloc_chrdev_region(), this isnt the > > case. Since its used for debug printing only, just excise the mess. > > > > Signed-of-by: Jim Cromie <jim.cromie@gmail.com> > > Reported-by: Robert P.J. Day <rpjday@crashcourse.ca> > > cc: Greg KH <greg@kroah.com. > > Signed-off-by: Jim Cromie <jim.cromie@gmail.com> > > --- > > drivers/char/pc8736x_gpio.c | 5 +---- > > 1 files changed, 1 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c > > index b304ec0..30d92fe 100644 > > --- a/drivers/char/pc8736x_gpio.c > > +++ b/drivers/char/pc8736x_gpio.c > > @@ -314,10 +314,7 @@ static int __init pc8736x_gpio_init(void) > > dev_err(&pdev->dev, "register-chrdev failed: %d\n", rc); > > goto undo_request_region; > > } > > - if (!major) { > > - major = rc; > > - dev_dbg(&pdev->dev, "got dynamic major %d\n", major); > > - } > > + dev_dbg(&pdev->dev, "using chardev major %d\n", major); > > > > pc8736x_init_shadow(); > > > > -- > > 1.7.4.2 > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fix bogus use of rc = alloc_chrdev_region() 2011-06-10 20:44 ` Greg KH @ 2011-06-14 14:07 ` Arnd Bergmann 2011-06-14 16:23 ` Grant Likely 0 siblings, 1 reply; 7+ messages in thread From: Arnd Bergmann @ 2011-06-14 14:07 UTC (permalink / raw) To: Greg KH; +Cc: Jim Cromie, linux-kernel, rpjday, Grant Likely On Friday 10 June 2011, Greg KH wrote: > On Fri, Jun 10, 2011 at 02:29:42PM -0600, Jim Cromie wrote: > > can someone pick this up, > > for this release or next ? > > It was rumored that Arnd wanted to take over drivers/char/. That's true. It probably means I should set up a tree now, before we get too close to the next merge window. On the topic of drivers/char/{nsc_gpio,pc8736x_gpio,scx200_gpio}, I wonder if we should move them to drivers/gpio/nsc_gpio despite the fact that they use a different (older) interface than all the other gpio drivers. They have seen only a single non-janitor patch in the last five years, so I don't think they will be a burden, but it might be nice to have them in a place where people would actually look for them, with a comment that they should be converted to the new API in order to be more useful. Arnd ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fix bogus use of rc = alloc_chrdev_region() 2011-06-14 14:07 ` Arnd Bergmann @ 2011-06-14 16:23 ` Grant Likely 2011-06-14 18:17 ` Arnd Bergmann 0 siblings, 1 reply; 7+ messages in thread From: Grant Likely @ 2011-06-14 16:23 UTC (permalink / raw) To: Arnd Bergmann; +Cc: Greg KH, Jim Cromie, linux-kernel, rpjday On Tue, Jun 14, 2011 at 8:07 AM, Arnd Bergmann <arnd@arndb.de> wrote: > On Friday 10 June 2011, Greg KH wrote: >> On Fri, Jun 10, 2011 at 02:29:42PM -0600, Jim Cromie wrote: >> > can someone pick this up, >> > for this release or next ? >> >> It was rumored that Arnd wanted to take over drivers/char/. > > That's true. It probably means I should set up a tree now, before we get > too close to the next merge window. > > On the topic of drivers/char/{nsc_gpio,pc8736x_gpio,scx200_gpio}, I wonder > if we should move them to drivers/gpio/nsc_gpio despite the fact that they > use a different (older) interface than all the other gpio drivers. I have no problem with moving them into drivers/gpio. When you do, please rename then drivers/gpio/gpio-*.c g. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fix bogus use of rc = alloc_chrdev_region() 2011-06-14 16:23 ` Grant Likely @ 2011-06-14 18:17 ` Arnd Bergmann 2011-06-14 18:23 ` Jim Cromie 2011-06-14 19:19 ` Grant Likely 0 siblings, 2 replies; 7+ messages in thread From: Arnd Bergmann @ 2011-06-14 18:17 UTC (permalink / raw) To: Grant Likely; +Cc: Greg KH, Jim Cromie, linux-kernel, rpjday On Tuesday 14 June 2011 18:23:50 Grant Likely wrote: > On Tue, Jun 14, 2011 at 8:07 AM, Arnd Bergmann <arnd@arndb.de> wrote: > > > On the topic of drivers/char/{nsc_gpio,pc8736x_gpio,scx200_gpio}, I wonder > > if we should move them to drivers/gpio/nsc_gpio despite the fact that they > > use a different (older) interface than all the other gpio drivers. > > I have no problem with moving them into drivers/gpio. When you do, > please rename then drivers/gpio/gpio-*.c Ok. Should they be in a subdirectory drivers/gpio/nsc_gpio/gpio_* for the nonstandard API or do you prefer them to live amongst the regular ones? Arnd ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fix bogus use of rc = alloc_chrdev_region() 2011-06-14 18:17 ` Arnd Bergmann @ 2011-06-14 18:23 ` Jim Cromie 2011-06-14 19:19 ` Grant Likely 1 sibling, 0 replies; 7+ messages in thread From: Jim Cromie @ 2011-06-14 18:23 UTC (permalink / raw) To: Arnd Bergmann; +Cc: Grant Likely, Greg KH, linux-kernel, rpjday On Tue, Jun 14, 2011 at 12:17 PM, Arnd Bergmann <arnd@arndb.de> wrote: > On Tuesday 14 June 2011 18:23:50 Grant Likely wrote: >> On Tue, Jun 14, 2011 at 8:07 AM, Arnd Bergmann <arnd@arndb.de> wrote: >> >> > On the topic of drivers/char/{nsc_gpio,pc8736x_gpio,scx200_gpio}, I wonder >> > if we should move them to drivers/gpio/nsc_gpio despite the fact that they >> > use a different (older) interface than all the other gpio drivers. >> >> I have no problem with moving them into drivers/gpio. When you do, >> please rename then drivers/gpio/gpio-*.c > > Ok. Should they be in a subdirectory drivers/gpio/nsc_gpio/gpio_* for the > nonstandard API or do you prefer them to live amongst the regular ones? > converting these to gpiolib has been on my list for a while, but pretty far down. Moving them is an easy 1st step. Once theyre converted, I guess they belong with the others, but its easy to move them again when the convert is done. preference ? > Arnd > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fix bogus use of rc = alloc_chrdev_region() 2011-06-14 18:17 ` Arnd Bergmann 2011-06-14 18:23 ` Jim Cromie @ 2011-06-14 19:19 ` Grant Likely 1 sibling, 0 replies; 7+ messages in thread From: Grant Likely @ 2011-06-14 19:19 UTC (permalink / raw) To: Arnd Bergmann; +Cc: Greg KH, Jim Cromie, linux-kernel, rpjday On Tue, Jun 14, 2011 at 12:17 PM, Arnd Bergmann <arnd@arndb.de> wrote: > On Tuesday 14 June 2011 18:23:50 Grant Likely wrote: >> On Tue, Jun 14, 2011 at 8:07 AM, Arnd Bergmann <arnd@arndb.de> wrote: >> >> > On the topic of drivers/char/{nsc_gpio,pc8736x_gpio,scx200_gpio}, I wonder >> > if we should move them to drivers/gpio/nsc_gpio despite the fact that they >> > use a different (older) interface than all the other gpio drivers. >> >> I have no problem with moving them into drivers/gpio. When you do, >> please rename then drivers/gpio/gpio-*.c > > Ok. Should they be in a subdirectory drivers/gpio/nsc_gpio/gpio_* for the > nonstandard API or do you prefer them to live amongst the regular ones?' I only see one files per non-standard driver. I wouldn't bother with subdirectories. Just put them in with the general population. g. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-06-14 19:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1307079502-6326-1-git-send-email-jim.cromie@gmail.com>
2011-06-10 20:29 ` [PATCH] fix bogus use of rc = alloc_chrdev_region() Jim Cromie
2011-06-10 20:44 ` Greg KH
2011-06-14 14:07 ` Arnd Bergmann
2011-06-14 16:23 ` Grant Likely
2011-06-14 18:17 ` Arnd Bergmann
2011-06-14 18:23 ` Jim Cromie
2011-06-14 19:19 ` Grant Likely
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox