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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD34AC433EF for ; Mon, 14 Mar 2022 08:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bv/iHXmJXevaRuFttqf1iIKOmwU9E/udRm5Na692IRo=; b=WTzHrZQBRDY7cH +YFwZ1kgc9zsNa88fYNTPLSti7HF8b+DA/igumuOMvUCNdbMwGy0ualAfl11xGigrK1AXsFSmjl3d pgxMsOX/adU8Ef8Dgf1hBAmlpWDw+jC5Mod3+uAQJ1AHzZCdDU9GQ5Lk+yGCCD3RDBXFEf/JquzGk /2eJ5FyZf/Qd98B1M0/VvRWJ898/mER0qDX9TZ85LETOXB/zgwXIPsOd3HWekZaCyYnFwpuBivE1d hXvv9Bo+HdnMXFDY5aWZXfTwcDnBkj2gFl7CzTPON0a8MC/7B6cF0bjV3supai4+pgc3Qcs8/gzQq Q+6vKaDMo2ebUDGrp3zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTfsp-004OoN-Ku; Mon, 14 Mar 2022 08:16:53 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTfcs-004HYA-2Q for linux-arm-kernel@lists.infradead.org; Mon, 14 Mar 2022 08:00:25 +0000 Received: by mail-wm1-x334.google.com with SMTP id r128-20020a1c4486000000b0038a12987e21so175776wma.4 for ; Mon, 14 Mar 2022 01:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Cfv85awAmoyZzNe4XhXxrHLPFirYqlR4GxEuXMqMPG0=; b=DpH1bJNPog08D3meVY94qXN/ZTbqAbz22x6qEBi18AI0VYBHw6WBAPeMRRQHnLK3ar 6HYGEv/sONT9p/YzmzdZ6x0n5bTSIzEpRrq8evBqUfUerZXm9mDecwejCayDb70xdG7A si5mAoEzOlZ9dvqP5coB2biSOtdVjibaVqwRORZpNfXQ1Guq+mQvlEsWdnkKdQ0KiIRS Cw8OHPaLOI7KY6AZESsF9Pl7sTyfKGx+6PnvoM0AbaY+3rToip30Sp2dwCH4yZO/XLXZ n3baygYKvIa3OTUtAteiF+YGnrI3kDcuOZyiUdN+6MMRuuF0d/Ik0M4DmI6pU7V3rkmD HSdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Cfv85awAmoyZzNe4XhXxrHLPFirYqlR4GxEuXMqMPG0=; b=8Fkt4aZ7CeN9CMMIMvmu+yjbvfWBTX5LeTMGV8szB/zR/xV7iafMq+RMwz7tQ2Oe/0 cF6R9x968Q1knyvp7tcOqII5v8ainf0f1vKOQAj3ygge/YvKsg5L5fY7J74gc4JP+cEo 62BpU5gmNAc3srHxApSdUAilJxX7LVF/x2q2wNRVbKN4ujKstbylWHQGRExZhLsz1XZm RincRGGci9ZZe3q38INZ6LVqHOO23b2qTXcyhoixlCXPG9Qgp9yA42Tzg3TN1Bn/p6J+ bXr8rc3tgLJq+oLmC8MI0XxuA4gUcedGOZydYINcYCEySSQlq4gUCqHx5147F71NFOMu yVSw== X-Gm-Message-State: AOAM531zKC2oeVbPU218SAE+8MJD+Ozw8rxt74FqfjlnUHoSMCabiMvh TMZP4We+FJnmuJD193UNVWsIdAXmJhEPnA== X-Google-Smtp-Source: ABdhPJzbOI0b73c/qadaAd7iEJGOVJ5hLgp/CgtYvpQSgMgQpjxw37Y+EMVduvNyqB6rfHgzaz11tw== X-Received: by 2002:a05:600c:4a12:b0:389:9c7d:5917 with SMTP id c18-20020a05600c4a1200b003899c7d5917mr16243062wmp.0.1647244819585; Mon, 14 Mar 2022 01:00:19 -0700 (PDT) Received: from localhost ([2a01:cb19:826e:8e00:bcd3:63d9:c9dc:840d]) by smtp.gmail.com with ESMTPSA id 10-20020adf808a000000b001edd413a952sm12568861wrl.95.2022.03.14.01.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 01:00:19 -0700 (PDT) From: Mattijs Korpershoek To: Andy Shevchenko , AngeloGioacchino Del Regno Cc: Dmitry Torokhov , Marco Felsch , Rob Herring , Matthias Brugger , Fengping Yu , Yingjoe Chen , Fabien Parent , Kevin Hilman , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v21 2/3] Input: mt6779-keypad - Add MediaTek keypad driver In-Reply-To: References: <20220303154302.252041-1-mkorpershoek@baylibre.com> <20220303154302.252041-3-mkorpershoek@baylibre.com> <300114e2-6794-db3c-a51c-3f900b6476f9@collabora.com> Date: Mon, 14 Mar 2022 09:00:18 +0100 Message-ID: <87ee35rmjx.fsf@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220314_010022_141436_6260E248 X-CRM114-Status: GOOD ( 21.81 ) 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 On ven., mars 04, 2022 at 14:38, Andy Shevchenko wrote: > On Fri, Mar 04, 2022 at 11:31:38AM +0100, AngeloGioacchino Del Regno wrote: >> Il 03/03/22 16:43, Mattijs Korpershoek ha scritto: >> > From: "fengping.yu" >> > >> > This patch adds matrix keypad support for Mediatek SoCs. > >> > +struct mt6779_keypad { >> > + struct regmap *regmap; >> > + struct input_dev *input_dev; >> > + struct clk *clk; > >> > + void __iomem *base; > > Not sure why you need this here. You are right. There is no point of keeping this __iomem region as part of the structure, since it's only used in the probe() function to create the regmap. Will send an improvement part of a later series. > >> > + u32 n_rows; >> > + u32 n_cols; >> > + DECLARE_BITMAP(keymap_state, MTK_KPD_NUM_BITS); >> > +}; >> > + >> > +static const struct regmap_config mt6779_keypad_regmap_cfg = { >> > + .reg_bits = 32, >> > + .val_bits = 32, >> > + .reg_stride = sizeof(u32), >> > + .max_register = 36, >> >> Are you sure that you can't use .fast_io = true? >> >> Another version for the same question: >> Are you sure that you need to lock with a mutex here, and not with a spinlock? >> >> Since you're performing reads over a MMIO, I think that there's a very good >> chance that you can use fast_io. >> >> > +}; > > ... > >> Please use dev_err_probe() to simplify error handling in probe functions: you've >> done a great job with adding a devm action for the error cases, avoiding gotos to >> get out cleanly.. it would be a pity to not finish this to perfection. >> >> I'll give you two examples for this, so that you'll be all set. >> >> if (IS_ERR(keypad->regmap)) >> return dev_err_probe(&pdev->dev, PTR_ERR(keypad->regmap), >> "regmap init failed\n"); >> >> P.S.: No need for %pe here, as dev_err_probe prints the error number for you! > > Maintainer of the input subsystem is strongly against dev_err_probe() API. See > other files there. Ditto for other cases you mentioned below. > > -- > With Best Regards, > Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel