All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firewire: core: add is_local sysfs device attribute
Date: Sun, 17 Jun 2012 19:56:17 +0200	[thread overview]
Message-ID: <20120617195617.372a35c5@stein> (raw)
In-Reply-To: <4FDDEC64.5080004@ladisch.de>

On Jun 17 Clemens Ladisch wrote:
> Making this information available in sysfs allows to differentiate
> between controllers in the local and remote Linux PCs, and thus is
> useful for servers that are started with udev rules.
> 
> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

Looks good to me.  Cc'ing LKML, and sending ABI documentation in a reply.

> ---
>  drivers/firewire/core-device.c |    9 +++++++++
>  include/linux/firewire.h       |    2 +-
>  2 files changed, 10 insertions(+), 1 deletions(-)
> 
> --- a/drivers/firewire/core-device.c
> +++ b/drivers/firewire/core-device.c
> @@ -398,6 +398,14 @@ static ssize_t guid_show(struct device *dev,
>  	return ret;
>  }
> 
> +static ssize_t is_local_show(struct device *dev,
> +			     struct device_attribute *attr, char *buf)
> +{
> +	struct fw_device *device = fw_device(dev);
> +
> +	return sprintf(buf, "%u\n", device->is_local);
> +}
> +
>  static int units_sprintf(char *buf, const u32 *directory)
>  {
>  	struct fw_csr_iterator ci;
> @@ -447,6 +455,7 @@ static ssize_t units_show(struct device *dev,
>  static struct device_attribute fw_device_attributes[] = {
>  	__ATTR_RO(config_rom),
>  	__ATTR_RO(guid),
> +	__ATTR_RO(is_local),
>  	__ATTR_RO(units),
>  	__ATTR_NULL,
>  };
> --- a/include/linux/firewire.h
> +++ b/include/linux/firewire.h
> @@ -152,7 +152,7 @@ static inline void fw_card_put(struct fw_card *card)
>  struct fw_attribute_group {
>  	struct attribute_group *groups[2];
>  	struct attribute_group group;
> -	struct attribute *attrs[12];
> +	struct attribute *attrs[13];
>  };
> 
>  enum fw_device_state {



-- 
Stefan Richter
-=====-===-- -==- =---=
http://arcgraph.de/sr/

       reply	other threads:[~2012-06-17 17:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4FDDEC64.5080004@ladisch.de>
2012-06-17 17:56 ` Stefan Richter [this message]
2012-06-17 17:57   ` [PATCH] firewire: core: document is_local sysfs attribute Stefan Richter

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=20120617195617.372a35c5@stein \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /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.