All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Joe Jin <joe.jin@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen: export device state to sysfs
Date: Tue, 28 Aug 2018 08:30:38 +0200	[thread overview]
Message-ID: <9a908520-0c53-075a-947d-de7741a8e29c@suse.com> (raw)
In-Reply-To: <030d112d-991f-4591-7eeb-94432a277c71@oracle.com>

On 27/08/18 20:44, Joe Jin wrote:
> Export device state to sysfs to allow for easier get device state.
> 
> Signed-off-by: Joe Jin <joe.jin@oracle.com>
> Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Juergen Gross <jgross@suse.com>

Please add the related documentation to

Documentation/ABI/stable/sysfs-bus-xen-backend


Juergen

> ---
>  drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index 74888cacd0b0..52f99b80a1c0 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -402,10 +402,19 @@ static ssize_t modalias_show(struct device *dev,
>  }
>  static DEVICE_ATTR_RO(modalias);
>  
> +static ssize_t state_show(struct device *dev,
> +			    struct device_attribute *attr, char *buf)
> +{
> +	return sprintf(buf, "%s\n",
> +			xenbus_strstate(to_xenbus_device(dev)->state));
> +}
> +static DEVICE_ATTR_RO(state);
> +
>  static struct attribute *xenbus_dev_attrs[] = {
>  	&dev_attr_nodename.attr,
>  	&dev_attr_devtype.attr,
>  	&dev_attr_modalias.attr,
> +	&dev_attr_state.attr,
>  	NULL,
>  };
>  
> 


  parent reply	other threads:[~2018-08-28  6:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-27 18:44 [PATCH] xen: export device state to sysfs Joe Jin
2018-08-28  6:30 ` Juergen Gross
2018-08-28  6:30 ` Juergen Gross [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-08-27 18:44 Joe Jin

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=9a908520-0c53-075a-947d-de7741a8e29c@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.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.