From: Greg KH <gregkh@linuxfoundation.org>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
devel@driverdev.osuosl.org, fmhess@users.sourceforge.net,
abbotti@mev.co.uk
Subject: Re: [PATCH] staging: comedi: introduce 'comedi_get_board' helper function
Date: Fri, 27 Apr 2012 12:29:00 -0700 [thread overview]
Message-ID: <20120427192900.GA14158@kroah.com> (raw)
In-Reply-To: <201204271149.49035.hartleys@visionengravers.com>
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.
How about renaming this to just be comedi_board() instead?
thanks,
greg k-h
next prev parent reply other threads:[~2012-04-27 19:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-27 18:49 [PATCH] staging: comedi: introduce 'comedi_get_board' helper function H Hartley Sweeten
2012-04-27 19:29 ` Greg KH [this message]
2012-04-27 20:13 ` H Hartley Sweeten
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=20120427192900.GA14158@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=fmhess@users.sourceforge.net \
--cc=hartleys@visionengravers.com \
--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