From patchwork Fri Sep 21 14:02:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Gasnier X-Patchwork-Id: 10610161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAA4B6CB for ; Fri, 21 Sep 2018 14:20:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A79662DF69 for ; Fri, 21 Sep 2018 14:20:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A57312DF97; Fri, 21 Sep 2018 14:20:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 174C22E15B for ; Fri, 21 Sep 2018 14:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=IZ5L28YaPdKLRsE3Nn2aeWVQqOdpz637zat49nCt/M0=; b=sSz6jynN3+Z9y2 tBRHrERzfovV0+oKvwzn0NRtPNlbmD6m6w7k+koxN4VQLDtg++x/6tI+HCNx42G6zr0X3pbFsOTM7 DG0mTNG53NWXD/VslN5+XrPpUN41m1m2wrKCtlqgXBiPrGqE3A9RHt+yReuJWjEgxLtEz3ZNg/niK xQ9tKRY482fuCeJZBve7JpeOj1jLOMHRAj6GKM92K+2FQfulhPSorCFFRrOSDP3gjWSzrwAtnqI2a YqOXln2R816uA5ltC04Kt5A4ortw0LPFGuCKFkrkBy/XIfm+vmNFD0qgk2G5nPALDiLXBjgff50wp nPEcTsmd3RW1y0P+/D/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3MIB-0002km-VX; Fri, 21 Sep 2018 14:20:24 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3MGl-0001FH-01; Fri, 21 Sep 2018 14:18:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Date:Subject:CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=C6UTtY+o6jp0C+8GNXjUEA87HW9F+TzFkqqYGXyjkoE=; b=cp9o8yfJ421IQE1yefafNBbXww 50N0y8pYMMLU4+ci0UGMg7IdzpQ8wfItFYZeCqsRmkJWR5idPjgj6MSRYjlVDzBdRCNq6N2pBXnaK VScJ7c06E+iV7aYF/cgAdH3S2yjxUE3ncsmdSqlGkqzS7clKoX8Vcz2tljN2PlfOe5HXwOqfm4VFE jLNfhF1xKqNQfu8juD81Ctb0DRJTIQsvasz8Yr0n5dqfcpEouI6zwiynEPsDEzfvisaEmabtoomrp YXmFor4CQv9DUVVE4DnyzkPlV4UXCtv05RrDtLNkvJbdDA/Cl5BDKkfHCWCmYSq93MySeRvl1jqDE 3Dx2674A==; Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3M1h-0001zI-P9; Fri, 21 Sep 2018 14:03:29 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w8LDx9pW022531; Fri, 21 Sep 2018 16:03:02 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2mmkmu4hg8-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 21 Sep 2018 16:03:02 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 60EF234; Fri, 21 Sep 2018 14:03:01 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 39678526A; Fri, 21 Sep 2018 14:03:01 +0000 (GMT) Received: from localhost (10.75.127.48) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 21 Sep 2018 16:03:00 +0200 From: Fabrice Gasnier To: , , Subject: [RESEND PATCH] Revert "pwm: Set class for exported channels in sysfs" Date: Fri, 21 Sep 2018 16:02:47 +0200 Message-ID: <1537538567-5377-1-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG4NODE3.st.com (10.75.127.12) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-09-21_05:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180921_150321_908661_E098A280 X-CRM114-Status: GOOD ( 12.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gottfried.haider@gmail.com, linux-pwm@vger.kernel.org, loic.pallardy@st.com, linux-kernel@vger.kernel.org, hsweeten@visionengravers.com, broonie@kernel.org, linux-rpi-kernel@lists.infradead.org, fabrice.gasnier@st.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 7e5d1fd75c3dde9fc10c4472b9368089d1b81d00 as it causes regression with multiple pwm chip. It creates a new entry in '/sys/class/pwm' every time a 'pwmX' is exported with 'echo X > export': - 1st time export will create an entry in /sys/class/pwm/pwmX - when another export happens on another pwmchip, it can't be created (e.g. -EEXIST) This also changes existing ABI (Documentation/ABI/testing/sysfs-class-pwm): - pmwX should be there: /sys/class/pwm/pwmchipN/pwmX Example on stm32 (stm32429i-eval) platform: $ ls /sys/class/pwm pwmchip0 pwmchip4 $ cd /sys/class/pwm/pwmchip0/ $ echo 0 > export $ ls /sys/class/pwm pwm0 pwmchip0 pwmchip4 $ cd /sys/class/pwm/pwmchip4/ $ echo 0 > export sysfs: cannot create duplicate filename '/class/pwm/pwm0' ...Exception stack follows... Signed-off-by: Fabrice Gasnier Tested-by: Gottfried Haider --- drivers/pwm/sysfs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index 7c71cdb..4726d43 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c @@ -263,7 +263,6 @@ 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);