From patchwork Tue Sep 26 11:59:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gohai@sukzessiv.net X-Patchwork-Id: 818603 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pwm-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y1ft81Qzlz9tX8 for ; Tue, 26 Sep 2017 22:10:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753160AbdIZMKj (ORCPT ); Tue, 26 Sep 2017 08:10:39 -0400 Received: from habibi.sukzessiv.net ([192.34.62.119]:36804 "EHLO habibi.sukzessiv.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752167AbdIZMKi (ORCPT ); Tue, 26 Sep 2017 08:10:38 -0400 X-Greylist: delayed 647 seconds by postgrey-1.27 at vger.kernel.org; Tue, 26 Sep 2017 08:10:38 EDT Received: by habibi.sukzessiv.net (Postfix, from userid 1000) id 325F060760; Tue, 26 Sep 2017 11:59:51 +0000 (UTC) Date: Tue, 26 Sep 2017 11:59:51 +0000 From: gohai@sukzessiv.net To: Thierry Reding Cc: H Hartley Sweeten , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, Gottfried Haider Subject: [RESEND][PATCH] pwm: Set class for exported channels in sysfs Message-ID: <20170926115951.GA29367@sukzessiv.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org Notifications for devices without bus or class set get dropped by dev_uevent_filter. Adding the class to the exported child matches what the gpio subsystem is doing. With this change exporting a channel triggers a udev event, which gives userspace a chance to fixup permissions and makes it possible for non-root users to make use of the pwm subsystem. Signed-off-by: Gottfried Haider CC: Thierry Reding CC: H Hartley Sweeten CC: linux-pwm@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org CC: linux-rpi-kernel@lists.infradead.org --- drivers/pwm/sysfs.c | 1 + 1 file changed, 1 insertion(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pwm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index a813239..83f2b0b 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c @@ -263,6 +263,7 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm) export->pwm = pwm; mutex_init(&export->lock); + export->child.class = parent->class; export->child.release = pwm_export_release; export->child.parent = parent; export->child.devt = MKDEV(0, 0);