From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932176AbcJETPx (ORCPT ); Wed, 5 Oct 2016 15:15:53 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:37703 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754351AbcJETPt (ORCPT ); Wed, 5 Oct 2016 15:15:49 -0400 Subject: Re: [PATCH] usb/core: Added devspec sysfs entry for devices behind usb hub To: Greg KH References: <1475607880-105300-1-git-send-email-vijay.ac.kumar@oracle.com> <20161004194932.GA28726@kroah.com> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Vijay Kumar Organization: Oracle Corporation Message-ID: Date: Wed, 5 Oct 2016 14:15:42 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161004194932.GA28726@kroah.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/4/2016 2:49 PM, Greg KH wrote: > 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 >> >> --- >> 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 >> #include >> #include >> +#include >> #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? Thanks for your comment. I looked into it again and find that grub would report ofpath incorrectly if CONFIG_OF not defined but devspec sysfs file exists. I see pci-sysfs.c has also defines devspec in same way. > > And you need to also update Documentation/ABI if you add a new sysfs > file. > Sure, if you agree with my above comment then should I make Document/ABI changes in a separate patch? Thanks, Vijay