From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756120AbbJUThw (ORCPT ); Wed, 21 Oct 2015 15:37:52 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:37300 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755536AbbJUTht convert rfc822-to-8bit (ORCPT ); Wed, 21 Oct 2015 15:37:49 -0400 Subject: Re: [PATCH v6 3/4] of: overlay: add per overlay sysfs attributes Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=utf-8 From: Pantelis Antoniou In-Reply-To: Date: Wed, 21 Oct 2015 22:37:45 +0300 Cc: Frank Rowand , Matt Porter , Koen Kooi , Guenter Roeck , Greg Kroah-Hartman , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" Content-Transfer-Encoding: 8BIT Message-Id: <1148C5AF-CA7C-44CE-9CBD-BCD949C6B5FD@konsulko.com> References: <1445368397-8732-1-git-send-email-pantelis.antoniou@konsulko.com> <1445368397-8732-4-git-send-email-pantelis.antoniou@konsulko.com> <8A0C91DE-EDF8-449D-918C-95C9807A7616@konsulko.com> To: Rob Herring X-Mailer: Apple Mail (2.2104) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, > On Oct 21, 2015, at 00:54 , Rob Herring wrote: > > On Tue, Oct 20, 2015 at 4:11 PM, Pantelis Antoniou > wrote: >> Hi Rob, >> >>> On Oct 21, 2015, at 00:04 , Rob Herring wrote: >>> >>> On Tue, Oct 20, 2015 at 2:13 PM, Pantelis Antoniou >>> wrote: >>>> * A per overlay can_remove sysfs attribute that reports whether >>>> the overlay can be removed or not due to another overlapping overlay. >>>> >>>> * A target sysfs attribute listing the target of each fragment, >>>> in a group named after the name of the fragment. > > [...] > >>>> @@ -255,6 +278,17 @@ err_fail: >>>> return -EINVAL; >>>> } >>>> >>>> +static ssize_t target_show(struct kobject *kobj, >>>> + struct fragment_attribute *fattr, char *buf) >>>> +{ >>>> + struct of_overlay_info *ovinfo = fattr->ovinfo; >>>> + >>>> + return snprintf(buf, PAGE_SIZE, "%s\n", >>>> + of_node_full_name(ovinfo->target)); >>> >>> This can be a link to the node itself, can't it? >>> >> >> Yes. Do you want it like this? > > Yes, hence the suggestion. Unless you see some reason why not. > Nope, can’t be done. The sysfs API only allows linking one kobj to another. The kobj is the overlay but the target is in the fragment attribute group. Sorry, I really tried, but can’t be done without hacking in a new link sysfs API. > Rob Regards — Pantelis