From: Duncan Sands <duncan.sands@math.u-psud.fr>
To: Simon Arlott <simon@fire.lp0.eu>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: [PATCH 3/8] cxacru: check device isn't being removed during sysfs calls
Date: Sat, 21 Nov 2009 16:24:16 +0100 [thread overview]
Message-ID: <4B080620.5050500@math.u-psud.fr> (raw)
In-Reply-To: <4B080344.5030104@simon.arlott.org.uk>
Hi Simon,
> +static inline void *to_usbatm_driver_data(struct usb_interface *intf)
> +{
> + struct usbatm_data *usbatm_instance;
> +
> + if (intf == NULL)
> + return NULL;
> +
> + usbatm_instance = usb_get_intfdata(intf);
> +
> + if (usbatm_instance == NULL) /* set NULL before unbind() */
> + return NULL;
> +
> + return usbatm_instance->driver_data; /* set NULL after unbind() */
> +}
> +
> +static inline void *to_usbatm_atm_dev(struct usb_interface *intf)
> +{
> + struct usbatm_data *usbatm_instance;
> +
> + if (intf == NULL)
> + return NULL;
> +
> + usbatm_instance = usb_get_intfdata(intf);
> +
> + if (usbatm_instance == NULL) /* set NULL before unbind() */
> + return NULL;
> +
> + return usbatm_instance->atm_dev; /* set NULL after unbind() */
> +}
> +
why not collapse these two into one that just returns usbatm_instance,
and have users extract the ->driver_data or ->atm_dev fields?
Ciao,
Duncan.
next prev parent reply other threads:[~2009-11-21 15:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-21 15:03 [PATCH 1/8] cxacru: return an empty value for modulation if there is no connection Simon Arlott
2009-11-21 15:07 ` [PATCH 2/8] cxacru: check data length is not negative Simon Arlott
2009-11-21 15:12 ` [PATCH 3/8] cxacru: check device isn't being removed during sysfs calls Simon Arlott
2009-11-21 15:24 ` Duncan Sands [this message]
2009-11-21 15:29 ` Simon Arlott
2009-11-21 15:33 ` [PATCH 3/8 (v2)] " Simon Arlott
2009-11-21 15:12 ` [PATCH 4/8] cxacru: document how to interact with the flash memory Simon Arlott
2009-11-21 15:12 ` [PATCH 5/8] cxacru: firmware writes on OHCI are slow, log progress Simon Arlott
2009-11-21 15:14 ` [PATCH 6/8] cxacru: add write-only sysfs attribute for modem configuration Simon Arlott
2009-11-21 15:15 ` [PATCH 7/8] cxacru: remove cxacru-cf.bin loader Simon Arlott
2009-11-21 15:16 ` [PATCH 8/8] cxacru: increment driver version Simon Arlott
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=4B080620.5050500@math.u-psud.fr \
--to=duncan.sands@math.u-psud.fr \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=simon@fire.lp0.eu \
/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®