Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760477AbZJMQrR (ORCPT ); Tue, 13 Oct 2009 12:47:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760141AbZJMQrQ (ORCPT ); Tue, 13 Oct 2009 12:47:16 -0400 Received: from mail-fx0-f227.google.com ([209.85.220.227]:55851 "EHLO mail-fx0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752949AbZJMQrQ convert rfc822-to-8bit (ORCPT ); Tue, 13 Oct 2009 12:47:16 -0400 MIME-Version: 1.0 In-Reply-To: <20091006074533.GA28889@july> References: <20091006074533.GA28889@july> From: Kay Sievers Date: Tue, 13 Oct 2009 18:45:48 +0200 Message-ID: Subject: Re: [PATCH] Haptic class support (v2) To: Kyungmin Park Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, soni.trilok@gmail.com, Greg Kroah-Hartmann Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1768 Lines: 41 On Tue, Oct 6, 2009 at 09:45, Kyungmin Park 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/