mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Vijay Kumar <vijay.ac.kumar@oracle.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb/core: Added devspec sysfs entry for devices behind usb hub
Date: Tue, 4 Oct 2016 21:49:32 +0200	[thread overview]
Message-ID: <20161004194932.GA28726@kroah.com> (raw)
In-Reply-To: <1475607880-105300-1-git-send-email-vijay.ac.kumar@oracle.com>

On Tue, Oct 04, 2016 at 12:04:40PM -0700, Vijay Kumar wrote:
> Grub finds incorrect of_node path for devices behind usb hub.
> Added devspec sysfs entry for devices behind usb hub so that
> right of_node path is returned during grub sysfs walk for these
> devices.
> 
> Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
> 
> ---
>  drivers/usb/core/sysfs.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
> index c953a0f..84d66d5 100644
> --- a/drivers/usb/core/sysfs.c
> +++ b/drivers/usb/core/sysfs.c
> @@ -14,6 +14,7 @@
>  #include <linux/string.h>
>  #include <linux/usb.h>
>  #include <linux/usb/quirks.h>
> +#include <linux/of.h>
>  #include "usb.h"
>  
>  /* Active configuration fields */
> @@ -104,6 +105,17 @@ static ssize_t bConfigurationValue_store(struct device *dev,
>  static DEVICE_ATTR_IGNORE_LOCKDEP(bConfigurationValue, S_IRUGO | S_IWUSR,
>  		bConfigurationValue_show, bConfigurationValue_store);
>  
> +#ifdef CONFIG_OF
> +static ssize_t devspec_show(struct device *dev, struct device_attribute *attr,
> +			     char *buf)
> +{
> +	struct device_node *of_node = dev->of_node;
> +
> +	return sprintf(buf, "%s\n", of_node_full_name(of_node));
> +}
> +static DEVICE_ATTR_RO(devspec);
> +#endif

Any way to do this without the #ifdef?

And you need to also update Documentation/ABI if you add a new sysfs
file.

thanks,

greg k-h

  reply	other threads:[~2016-10-04 19:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 19:04 Vijay Kumar
2016-10-04 19:49 ` Greg KH [this message]
2016-10-05 19:15   ` Vijay Kumar

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=20161004194932.GA28726@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=vijay.ac.kumar@oracle.com \
    /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

Powered by JetHome