From: Kay Sievers <kay.sievers@vrfy.org>
To: Kyungmin Park <kmpark@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
soni.trilok@gmail.com, Greg Kroah-Hartmann <greg@kroah.com>
Subject: Re: [PATCH] Haptic class support (v2)
Date: Tue, 13 Oct 2009 18:45:48 +0200 [thread overview]
Message-ID: <ac3eb2510910130945w2e87d84bjfa3291989d85375b@mail.gmail.com> (raw)
In-Reply-To: <20091006074533.GA28889@july>
On Tue, Oct 6, 2009 at 09:45, Kyungmin Park <kmpark@infradead.org> wrote:
> +/**
> + * haptic_classdev_register - register a new object of haptic_classdev class.
> + * @dev: The device to register.
> + * @haptic_cdev: the haptic_classdev structure for this device.
> + */
> +int haptic_classdev_register(struct device *parent,
> + struct haptic_classdev *haptic_cdev)
> +{
> + int ret;
> +
> + haptic_cdev->dev = device_create(haptic_class, parent, 0,
> + haptic_cdev, "%s", haptic_cdev->name);
> + if (IS_ERR(haptic_cdev->dev))
> + return PTR_ERR(haptic_cdev->dev);
> +
> + /* register the attributes */
> + ret = class_create_file(haptic_class, &class_attr_enable);
> + if (ret) {
> + printk(KERN_ERR "%s: class_create_file(enable) failed\n",
> + __func__);
> + return ret;
> + }
As mentioned in an earlier mail, this needs some explanation. What are
you doing here? Creating a device below a class, and then add a bunch
of attributes to the class itself, instead of the device you created?
All calls to class_create_file() need to go, we can not allow any new
users of this broken interface. As mentioned, if you need
subsystem-wide attributes you need to use a bus and not a class,
classes are flat and can not handle such things properly.
Thanks,
Kay
next prev parent reply other threads:[~2009-10-13 16:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 7:45 [PATCH] Haptic class support (v2) Kyungmin Park
2009-10-06 15:25 ` Randy Dunlap
2009-10-06 18:35 ` Trilok Soni
2009-10-07 5:13 ` Kyungmin Park
2009-10-11 9:05 ` Pavel Machek
2009-10-12 0:32 ` Kyungmin Park
2009-10-12 13:44 ` Trilok Soni
2009-10-12 14:40 ` Greg KH
2009-10-13 11:05 ` Pavel Machek
2009-10-12 15:42 ` Kay Sievers
2009-10-12 16:20 ` Mark Brown
2009-10-13 16:45 ` Kay Sievers [this message]
2009-10-20 6:44 ` Trilok Soni
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=ac3eb2510910130945w2e87d84bjfa3291989d85375b@mail.gmail.com \
--to=kay.sievers@vrfy.org \
--cc=greg@kroah.com \
--cc=kmpark@infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=soni.trilok@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;
as well as URLs for NNTP newsgroup(s).