From: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
To: Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
Cc: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Frank Rowand
<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Matt Porter <mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>,
Koen Kooi
<koen-QLwJDigV5abLmq1fohREcCpxlwaOVQ5f@public.gmane.org>,
Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Pantelis Antoniou
<panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
Subject: Re: [PATCH v7 5/6] of: overlay: add per overlay sysfs attributes
Date: Thu, 22 Oct 2015 13:21:41 -0700 [thread overview]
Message-ID: <20151022202141.GE27977@kroah.com> (raw)
In-Reply-To: <1445543427-26275-6-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
On Thu, Oct 22, 2015 at 10:50:26PM +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-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> ---
> 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 91f10ed..6398810 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];
> + struct fragment_attribute target_attr;
> };
>
> /**
> @@ -52,6 +72,7 @@ struct of_overlay {
> struct list_head node;
> int count;
> struct of_overlay_info *ovinfo_tab;
> + const struct attribute_group **attr_groups;
> struct of_changeset cset;
> struct kobject kobj;
> };
> @@ -252,6 +273,8 @@ static int of_fill_overlay_info(struct of_overlay *ov,
> if (ovinfo->target == NULL)
> goto err_fail;
>
> + ovinfo->info = of_node_get(info_node);
> +
> return 0;
>
> err_fail:
> @@ -262,6 +285,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));
Same minor nit here, but really not a big deal, nice job overall with
this, sorry working with 'raw' kobjects is so messy.
Acked-by: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
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,
Pantelis Antoniou <panto@antoniou-consulting.com>
Subject: Re: [PATCH v7 5/6] of: overlay: add per overlay sysfs attributes
Date: Thu, 22 Oct 2015 13:21:41 -0700 [thread overview]
Message-ID: <20151022202141.GE27977@kroah.com> (raw)
In-Reply-To: <1445543427-26275-6-git-send-email-pantelis.antoniou@konsulko.com>
On Thu, Oct 22, 2015 at 10:50:26PM +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 91f10ed..6398810 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];
> + struct fragment_attribute target_attr;
> };
>
> /**
> @@ -52,6 +72,7 @@ struct of_overlay {
> struct list_head node;
> int count;
> struct of_overlay_info *ovinfo_tab;
> + const struct attribute_group **attr_groups;
> struct of_changeset cset;
> struct kobject kobj;
> };
> @@ -252,6 +273,8 @@ static int of_fill_overlay_info(struct of_overlay *ov,
> if (ovinfo->target == NULL)
> goto err_fail;
>
> + ovinfo->info = of_node_get(info_node);
> +
> return 0;
>
> err_fail:
> @@ -262,6 +285,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));
Same minor nit here, but really not a big deal, nice job overall with
this, sorry working with 'raw' kobjects is so messy.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
next prev parent reply other threads:[~2015-10-22 20:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 19:50 [PATCH v7 0/6] of: overlay: kobject & sysfs'ation Pantelis Antoniou
2015-10-22 19:50 ` Pantelis Antoniou
2015-10-22 19:50 ` [PATCH v7 1/6] of: overlay: kobjectify overlay objects Pantelis Antoniou
[not found] ` <1445543427-26275-2-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-10-22 20:17 ` Greg Kroah-Hartman
2015-10-22 20:17 ` Greg Kroah-Hartman
2015-10-22 19:50 ` [PATCH v7 2/6] of: overlay: global sysfs enable attribute Pantelis Antoniou
[not found] ` <1445543427-26275-3-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-10-22 20:19 ` Greg Kroah-Hartman
2015-10-22 20:19 ` Greg Kroah-Hartman
[not found] ` <20151022201911.GB27977-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-10-22 20:25 ` Pantelis Antoniou
2015-10-22 20:25 ` Pantelis Antoniou
[not found] ` <1445543427-26275-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-10-22 19:50 ` [PATCH v7 3/6] Documentation: ABI: overlays - global attributes Pantelis Antoniou
2015-10-22 19:50 ` Pantelis Antoniou
[not found] ` <1445543427-26275-4-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-10-22 20:19 ` Greg Kroah-Hartman
2015-10-22 20:19 ` Greg Kroah-Hartman
2015-10-22 19:50 ` [PATCH v7 6/6] Documentation: ABI: overlays - per overlay docs Pantelis Antoniou
2015-10-22 19:50 ` Pantelis Antoniou
[not found] ` <1445543427-26275-7-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-10-22 20:22 ` Greg Kroah-Hartman
2015-10-22 20:22 ` Greg Kroah-Hartman
2015-10-22 19:50 ` [PATCH v7 4/6] Documentation: document of_overlay_disable parameter Pantelis Antoniou
2015-10-22 20:19 ` Greg Kroah-Hartman
2015-10-22 19:50 ` [PATCH v7 5/6] of: overlay: add per overlay sysfs attributes Pantelis Antoniou
[not found] ` <1445543427-26275-6-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-10-22 20:21 ` Greg Kroah-Hartman [this message]
2015-10-22 20:21 ` Greg Kroah-Hartman
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=20151022202141.GE27977@kroah.com \
--to=gregkh-hqyy1w1ycw8ekmwlsbkhg0b+6bgklq7r@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=koen-QLwJDigV5abLmq1fohREcCpxlwaOVQ5f@public.gmane.org \
--cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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.