All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Simon Arlott <simon@fire.lp0.eu>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Duncan Sands <duncan.sands@math.u-psud.fr>,
	Krzysztof Lichota <krzysiek@lichota.net>
Subject: Re: [PATCH 1/2] cxacru: Create sysfs attributes in atm_start instead of bind
Date: Fri, 4 May 2007 14:14:41 -0700	[thread overview]
Message-ID: <20070504141441.6e327140.akpm@linux-foundation.org> (raw)
In-Reply-To: <463B675A.10900@simon.arlott.org.uk>

On Fri, 04 May 2007 18:03:22 +0100
Simon Arlott <simon@fire.lp0.eu> wrote:

> Since usbatm doesn't set the usb_interface driver data until after calling bind 
> and heavy_init, it would be NULL when the sysfs attributes are read. Reading the 
> MAC address from atm_dev before atm_dev exists would have been be possible too.
> 
> Calling create_device_file in atm_start will avoid this problem, and the data 
> is useless until the first status poll runs. However, it must be ready before a 
> status poll does a printk on line status change otherwise userspace could react 
> before the files exist.
> 
> For completeness I've moved remove_device_file to atm_stop so it's not called in 
> unbind when it's not needed.
> 

This patch is mysteriously mangled.

> 
> drivers/usb/atm/cxacru.c |   45 +++++++++++++++++++++++++--------------------
> 1 files changed, 25 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
> index 0b12ace..4ecb4c7 100644
> --- a/drivers/usb/atm/cxacru.c
> +++ b/drivers/usb/atm/cxacru.c
> @@ -618,10 +618,22 @@ static int cxacru_card_status(struct cxacru_data *instance)
> 	return 0;
> }
> 
> +static void cxacru_remove_device_files(struct usbatm_data *usbatm_instance,
> +		struct atm_dev *atm_dev)
> +{
> +	struct usb_interface *intf = usbatm_instance->usb_intf;
> +
> +	#define CXACRU_DEVICE_REMOVE_FILE(_name) \
> +		device_remove_file(&intf->dev, &dev_attr_##_name);
> +	CXACRU_ALL_FILES(REMOVE);
> +	#undef CXACRU_DEVICE_REMOVE_FILE
> +}
> +
> static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
> 		struct atm_dev *atm_dev)
> {

See, that "^{" should have been "^ {".  Something has gobbled the leading
space.

Anyway, after some futzing around I was able to determine that this patch
is identical to the one I already have.  Ho hum.


      reply	other threads:[~2007-05-04 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-04 17:03 [PATCH 1/2] cxacru: Create sysfs attributes in atm_start instead of bind Simon Arlott
2007-05-04 21:14 ` Andrew Morton [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=20070504141441.6e327140.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=duncan.sands@math.u-psud.fr \
    --cc=krzysiek@lichota.net \
    --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 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.