mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rob Herring <robherring2@gmail.com>,
	Frank Rowand <frowand.list@gmail.com>,
	Matt Porter <mporter@konsulko.com>,
	Koen Kooi <koen@dominion.thruhere.net>,
	Guenter Roeck <linux@roeck-us.net>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org
Subject: Re: [PATCH v6 3/4] of: overlay: add per overlay sysfs attributes
Date: Wed, 21 Oct 2015 00:15:00 +0300	[thread overview]
Message-ID: <D2471EF1-6837-41CC-8205-FE7D8573ACC3@konsulko.com> (raw)
In-Reply-To: <20151020210806.GC28724@kroah.com>

Hi Greg,

> On Oct 21, 2015, at 00:08 , Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> 
> On Tue, Oct 20, 2015 at 10:13:16PM +0300, 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.
>> 
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
>> ---
>> drivers/of/overlay.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++++--
>> 1 file changed, 99 insertions(+), 4 deletions(-)
>> 
>> diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
>> index 067404e..2d51d9e2 100644
>> --- a/drivers/of/overlay.c
>> +++ b/drivers/of/overlay.c
>> @@ -25,8 +25,23 @@
>> 
>> #include "of_private.h"
>> 
>> +/* fwd. decl */
>> +struct of_overlay;
>> +struct of_overlay_info;
>> +
>> +/* an attribute for each fragment */
>> +struct fragment_attribute {
>> +	struct attribute attr;
>> +	ssize_t (*show)(struct kobject *kobj, struct fragment_attribute *fattr,
>> +			char *buf);
>> +	ssize_t (*store)(struct kobject *kobj, struct fragment_attribute *fattr,
>> +			 const char *buf, size_t count);
>> +	struct of_overlay_info *ovinfo;
>> +};
>> +
>> /**
>>  * struct of_overlay_info - Holds a single overlay info
>> + * @info:	info node that contains the target and overlay
>>  * @target:	target of the overlay operation
>>  * @overlay:	pointer to the overlay contents node
>>  *
>> @@ -34,8 +49,13 @@
>>  * records.
>>  */
>> struct of_overlay_info {
>> +	struct of_overlay *ov;
>> +	struct device_node *info;
>> 	struct device_node *target;
>> 	struct device_node *overlay;
>> +	struct attribute_group attr_group;
>> +	struct attribute *attrs[2];
> 
> Why both 2 attributes _and_ an attribute group?  Why not put the
> attributes in the attribute group?
> 
> And why just one attribute group?  Why not an array of them like the
> rest of the kernel is used to handle?
> 

Because this makes it easier to add all the attributes for all the fragments in a single
sysfs_create_groups() call, once for each overlay, instead of having a call to 
sysfs_create_group() for each fragment of the overlay.

Reusing driver core helpers is good, no?

> thanks,
> 
> greg k-h

Regards

— Pantelis


  reply	other threads:[~2015-10-20 21:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20 19:13 [PATCH v6 0/4] of: overlay: kobject & sysfs'ation Pantelis Antoniou
2015-10-20 19:13 ` [PATCH v6 1/4] of: overlay: kobjectify overlay objects Pantelis Antoniou
2015-10-20 21:03   ` Greg Kroah-Hartman
2015-10-21 13:28     ` Pantelis Antoniou
2015-10-21 15:22       ` Greg Kroah-Hartman
2015-10-20 19:13 ` [PATCH v6 2/4] of: overlay: global sysfs enable attribute Pantelis Antoniou
2015-10-20 21:06   ` Greg Kroah-Hartman
2015-10-20 21:50     ` Rob Herring
2015-10-21  8:47       ` Pantelis Antoniou
2015-10-20 19:13 ` [PATCH v6 3/4] of: overlay: add per overlay sysfs attributes Pantelis Antoniou
2015-10-20 21:04   ` Rob Herring
2015-10-20 21:11     ` Pantelis Antoniou
2015-10-20 21:54       ` Rob Herring
2015-10-21 19:37         ` Pantelis Antoniou
2015-10-21 21:52           ` Rob Herring
2015-10-22 16:15             ` Pantelis Antoniou
2015-11-05 19:52               ` Rob Herring
2015-11-05 20:17                 ` Pantelis Antoniou
2015-10-20 21:08   ` Greg Kroah-Hartman
2015-10-20 21:15     ` Pantelis Antoniou [this message]
2015-10-20 23:25       ` Greg Kroah-Hartman
2015-10-20 19:13 ` [PATCH v6 4/4] Documentation: ABI: /sys/firmware/devicetree/overlays Pantelis Antoniou
2015-10-20 20:56   ` Rob Herring
2015-10-20 21:02     ` Pantelis Antoniou
2015-10-20 22:00       ` Rob Herring
2015-10-20 21:06 ` [PATCH v6 0/4] of: overlay: kobject & sysfs'ation Rob Herring
2015-10-20 21:11   ` Pantelis Antoniou
2015-10-20 21:52     ` Rob Herring

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=D2471EF1-6837-41CC-8205-FE7D8573ACC3@konsulko.com \
    --to=pantelis.antoniou@konsulko.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=koen@dominion.thruhere.net \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mporter@konsulko.com \
    --cc=robherring2@gmail.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

all inboxes | Powered by JetHome®