From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FACDC433B4 for ; Tue, 18 May 2021 06:07:26 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 41F5961184 for ; Tue, 18 May 2021 06:07:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41F5961184 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eaKhlWzc19u8tbhnDC1+OAxTwDzmxsSVk9kBtkn3G0w=; b=Kn3FbnWWktDvLPA51zli0Rar2 BQCvf9tl1IO4CclJ1tWrEYNzjWTHgCirTe02IEGCFgHd22/Q7B2XiDSybQ4BzviPXYV6J6Lz+nGV2 Xm8+HlwpShFgEGH6TUGurKzEosDc8K8MslTe9FUHQRintlbgVxX1ylsYg1ImpNt8EzCFWMLRU3ZgO igywsQOkvn2R6+KwjUnjGs/LDkGogGqQVKsMFXToqIAwuhQIU4Kw480Fz/o68nlrTq8YPwrr3YBnr WVxuMcS/8f/+4VDJoqwTxF8oTQGh0K3UQVC9ZHkYQy1QF3lv4pp9ZrOKaZprP0jjbKNs2SSBX95KW wNI/FqSUA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lisrI-00H7sg-Qq; Tue, 18 May 2021 06:05:37 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lisrG-00H7sM-G0 for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 06:05:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=f1OTt6o1zV/HcygNNA1gH0D+V8FIvIJiLu1uDJk2oI4=; b=4LJU8Zr+U4Kyzseu4ch1gsIRZa nmEDItvWyd849f8/jJX3eTcrLhlTVoER7QOdqBq2N/Pj0AIz8K10JqsSSj4vMNJHy+IcjUJK0Xw3E JEgPGKtvYKcYh4OqCXtpUGomvUBfWyI0iOj4NTzvbSbTMvC69ctGVuvjdzex6zmN+gbMtuAT3hQuK EEAXsZWRXW36vbdWF7VRXQ4V39ZdI4WGPr6afu6elDNIM0GhBk0t8K+LSBsHwom/2C97qby1TgcHy 1zNCFMkDTHtjQLExKP65EVDQj8Dtj4+3VHHdQmR1wJK+4wrC+Yb0Sb38pkMUH/r7m9ETO7XGmYL58 XfkglPtg==; Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lisrD-00ELFa-SL for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 06:05:33 +0000 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 5E32D80BA; Tue, 18 May 2021 06:05:30 +0000 (UTC) Date: Tue, 18 May 2021 09:05:23 +0300 From: Tony Lindgren To: Dario Binacchi Cc: linux-kernel@vger.kernel.org, Haojian Zhuang , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCH v2 2/2] pinctrl: single: set pinmux from pins debug file Message-ID: References: <20210517200002.6316-1-dariobin@libero.it> <20210517200002.6316-3-dariobin@libero.it> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210517200002.6316-3-dariobin@libero.it> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_230531_981604_48D4C9AE X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, I noticed few more things I started to wonder about after looking at this again. * Dario Binacchi [210517 20:00]: > +static int pcs_pin_dbg_set(struct pinctrl_dev *pctldev, unsigned int pin, > + char *buf) > +{ > + struct pcs_device *pcs; > + unsigned int val, mux_bytes; > + > + buf = skip_spaces(buf); > + if (kstrtouint(buf, 0, &val)) > + return -EINVAL; > + > + pcs = pinctrl_dev_get_drvdata(pctldev); > + > + mux_bytes = pcs->width / BITS_PER_BYTE; > + pcs->write(val, pcs->base + pin * mux_bytes); > + return 0; > +} Since you're adding a new interface, how about pass unsigned int val instead of char *buf? > static void pcs_dt_free_map(struct pinctrl_dev *pctldev, > struct pinctrl_map *map, unsigned num_maps) > { > @@ -331,6 +348,9 @@ static const struct pinctrl_ops pcs_pinctrl_ops = { > .get_group_name = pinctrl_generic_get_group_name, > .get_group_pins = pinctrl_generic_get_group_pins, > .pin_dbg_show = pcs_pin_dbg_show, > +#if IS_ENABLED(CONFIG_DEVMEM) > + .pin_dbg_set = pcs_pin_dbg_set, > +#endif > .dt_node_to_map = pcs_dt_node_to_map, > .dt_free_map = pcs_dt_free_map, > }; It might be better to always have the .pin_dbg_set around to avoid the IS_ENABLED(CONFIG_DEVMEM). Does the new interface need something under Documentation too? Regards, Tony _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel