From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"fmhess@users.sourceforge.net" <fmhess@users.sourceforge.net>,
"abbotti@mev.co.uk" <abbotti@mev.co.uk>
Subject: RE: [PATCH] staging: comedi: introduce 'comedi_get_board' helper function
Date: Fri, 27 Apr 2012 15:13:05 -0500 [thread overview]
Message-ID: <ADE657CA350FB648AAC2C43247A983F002069887EFFF@AUSP01VMBX24.collaborationhost.net> (raw)
In-Reply-To: <20120427192900.GA14158@kroah.com>
On Friday, April 27, 2012 12:29 PM, Greg KH wrote:
> On Fri, Apr 27, 2012 at 11:49:48AM -0700, H Hartley Sweeten wrote:
>> This helper function is used to fetch the comedi_device board_ptr
>> which is used during the attach to pass board specific information
>> to the comedi drivers.
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>> Cc: Ian Abbott <abbotti@mev.co.uk>
>> Cc: Mori Hess <fmhess@users.sourceforge.net>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>
>> ---
>>
>> With this helper removing all the 'this_board' defines in the drivers
>> will be easier (and cleaner).
>>
>> diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
>> index 300fd84..53a05dd 100644
>> --- a/drivers/staging/comedi/comedidev.h
>> +++ b/drivers/staging/comedi/comedidev.h
>> @@ -235,6 +235,11 @@ struct comedi_device {
>> void (*close) (struct comedi_device *dev);
>> };
>>
>> +static inline const void *comedi_get_board(struct comedi_device *dev)
>> +{
>> + return dev->board_ptr;
>> +}
>
> "traditionally" the *get* functions increment a reference count of the
> pointer it returns, which isn't happening here.
I was trying to model it after dev_get_drvdata. But I see what you mean.
> How about renaming this to just be comedi_board() instead?
Or comedi_board_ptr... Either one works for me but I do like the shorter
name you suggested.
I'll post an updated patch shortly using the comedi_board name.
Regards,
Hartley
prev parent reply other threads:[~2012-04-27 20:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-27 18:49 H Hartley Sweeten
2012-04-27 19:29 ` Greg KH
2012-04-27 20:13 ` H Hartley Sweeten [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=ADE657CA350FB648AAC2C43247A983F002069887EFFF@AUSP01VMBX24.collaborationhost.net \
--to=hartleys@visionengravers.com \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=fmhess@users.sourceforge.net \
--cc=gregkh@linuxfoundation.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®