public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: Zhang Rui <rui.zhang@intel.com>
Cc: "lenb@kernel.org" <lenb@kernel.org>,
	"kay.sievers@vrfy.org" <kay.sievers@vrfy.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	Bjorn Helgaas <bjorn.helgaas@hp.com>
Subject: Re: [PATCH 1/2] ACPI: Do not export hid/modalias sysfs file for ACPI objects without a HID
Date: Fri, 8 Oct 2010 09:27:56 +0200	[thread overview]
Message-ID: <201010080927.56406.trenn@suse.de> (raw)
In-Reply-To: <1286497581.2111.3753.camel@rui>

On Friday 08 October 2010 02:26:21 Zhang Rui wrote:
> On Fri, 2010-10-01 at 16:53 +0800, Thomas Renninger wrote:
> > Boot and compile tested.
> > The fact that pnp.ids can now be empty needs testing on some
> > further machines, though.
...
> > -	result = device_create_file(&dev->dev, &dev_attr_hid);
> > -	if (result)
> > -		goto end;
> > +	if (!list_empty(&dev->pnp.ids)) {
> > +		result = device_create_file(&dev->dev, &dev_attr_hid);
> > +		if (result)
> > +			goto end;
> >  
> > -	result = device_create_file(&dev->dev, &dev_attr_modalias);
> > -	if (result)
> > -		goto end;
> > +		result = device_create_file(&dev->dev, &dev_attr_modalias);
> > +		if (result)
> > +			goto end;
> > +	}
> >  
> 
> the "hid" attribute exports the first entry of the device.pnp..ids list,
> while "modalias" exports all the entries.
> now it seems that the "hid" file is redundant, right?
Yep. You need some parsing, but udev is already doing that.
But it's sysfs api..., you'd need to add a:
printk_once("Deprecated HID file accessed by %s, use modalias instead\n",
              current->comm);
and deprecate that for some years.

    Thomas

      reply	other threads:[~2010-10-08  7:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01  8:53 [PATCH 1/2] ACPI: Do not export hid/modalias sysfs file for ACPI objects without a HID Thomas Renninger
2010-10-01  8:54 ` [PATCH 2/2] ACPI/PNP: A HID value of an object never changes -> make it const Thomas Renninger
2010-10-01 19:49   ` Len Brown
2010-10-01 19:48 ` [PATCH 1/2] ACPI: Do not export hid/modalias sysfs file for ACPI objects without a HID Len Brown
2010-10-08  0:26 ` Zhang Rui
2010-10-08  7:27   ` Thomas Renninger [this message]

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=201010080927.56406.trenn@suse.de \
    --to=trenn@suse.de \
    --cc=bjorn.helgaas@hp.com \
    --cc=kay.sievers@vrfy.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rui.zhang@intel.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