Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp439878rwb; Thu, 10 Nov 2022 03:03:26 -0800 (PST) X-Google-Smtp-Source: AMsMyM5q4/ivYVOkYk076jSV9qrLkuPIf4JLkwIqZqd0ujcJWPIvMg/XAlP2lH/H26DmZEGm49VD X-Received: by 2002:a17:906:9bd4:b0:7ad:2d86:418c with SMTP id de20-20020a1709069bd400b007ad2d86418cmr60219008ejc.380.1668078205812; Thu, 10 Nov 2022 03:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668078205; cv=none; d=google.com; s=arc-20160816; b=mlsuvjm3n0AEIjicYS6w2Us8OetKua+0fe/cWTXcMjDY/7G3FjGk8yXuw0+t3MNGzI iM1BYduhnmf8retLeHZMMtuxt3oKRDSqkNkcEjQtBfLVqpvmlpMQH3fehd2FwpenL9tT vZKT1PyBVe6PrmpfyXqVmGFFZ6J361d5hN+UPVNscH0rDehfYIqb1LFT5wbfZ9Tt+F5t VetSPUUXDGZJye+nX0YbNwm0PaQ0kKpYBO3kZ5g1AJp3JHDQ7OVRcmNfItCQ1UxAZ58Y +SV7/MZggw4Wu0z1ktgXCGI9msJISLoAdCO8V5dC5o6J/EX2kTdUX+kWBtbP8YZy5AE6 wdxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2XV85RM2D5cPjJ+hWNkLRIR1G9UoikIDXt1LLlRhD8A=; b=qgegsccA7gFH8cLapBKtCcvuQjgVSOYfKLy2ZIatNZ7cxDq8LqrhIv4NScVq4SvJ6D mx2eF1WWJqP4ZOu89kJjeHPGMMXBpKb8VTIuh502rpKLoeTqPcKlsyoiBXDeXsqLp7Ff fuROxSfl/Mxu/SSpom/adoa33bvLTlQFcNgEZZi0V4bHBtiutA4LZY+5VVw+B5MlHXqm J/pD22oyAW6csRVPLV9HT/96IPtsLeLln6J1TFli9QmWlc23CDLd3RsIrKWz4B5Av51M A4NmLr8TbRytiaF5YWK0jLQNyBdgaPtrkCRVDRZLOw/7in+s2I++ArYpGxqRFKBjQ65C CKKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qwwP6pmh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020a05640211cc00b00461b0566a29si19718681edw.137.2022.11.10.03.03.02; Thu, 10 Nov 2022 03:03:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qwwP6pmh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbiKJKEP (ORCPT + 92 others); Thu, 10 Nov 2022 05:04:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbiKJKEN (ORCPT ); Thu, 10 Nov 2022 05:04:13 -0500 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4376AECA; Thu, 10 Nov 2022 02:04:12 -0800 (PST) Received: by mail-qk1-x72a.google.com with SMTP id z17so774468qki.11; Thu, 10 Nov 2022 02:04:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2XV85RM2D5cPjJ+hWNkLRIR1G9UoikIDXt1LLlRhD8A=; b=qwwP6pmhD2bq2AH8IBA0Rh1N4i9O/412YKIKLExn+zHrY9YTlyQ//cUDeOa7bjPHms +L1q0CGTs3b/kyHb3g66t3mRyI49Wob8/nZF59DMBZbsgmzVUh8TFZTWN4Kpqt6+fD1h V3UmjGtJDArMDjkrwQFtOgf3BSObX904yIe8Bs0B4JVQbs1Tko5/cq1yQO/Hd5LvzuG3 Xs31Uc41I0GCXlhGg42qUHe+w7n/LxEkGpkztdmPjg8vWRINNpRfsSvq/WZlGrqJKOmz p5OdRwWsjqHlcgF9Vbbxsl29vcgwA5TAdIcfZ6zaTJPpk8Ktnz6TogamhZLEfHkBXZc0 C0yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2XV85RM2D5cPjJ+hWNkLRIR1G9UoikIDXt1LLlRhD8A=; b=6Cg5nKkLOYq6GyGUJX2xs4trfrU4ijIP1DRQPnTUTuJ0mNs5o84ZOviyKumpZ53pMh 9uumbUBu5/JfSoVJsBngiiofj+pARstuQ52LhshjYi9f5kXBrZDJt+52p6tR1gY/zMni 4EW6AQ4Dv/DdhrPf40zPrcjF4joQqB60/ffUxN2r3aN0gH5TWpr8O6B/ckRh6XMefDq6 FOA9xElh9jIL+6S8T/mXvwOKT9VSBVgt9MAux7mGEYi/UxTu1IuKeJTnUoIKTGc3zkvI 00w5KqPoOYSXHpS+K4luNp4VKkEwzZq/w8PiMG0Va6rTCjbKQaYfBl5i+MdRbyLapsjC TKSw== X-Gm-Message-State: ANoB5pn1BlVQYA473hZO8GP/hfUGqzDkm52TptrqbO14STLUtgTjHup8 CBRclg3yww/lq1YTFMNoLVOGfoRHUDtgko4t5h5VDj3A870bpPM4 X-Received: by 2002:a37:8784:0:b0:6fb:25ba:3d32 with SMTP id j126-20020a378784000000b006fb25ba3d32mr547170qkd.504.1668074651427; Thu, 10 Nov 2022 02:04:11 -0800 (PST) MIME-Version: 1.0 References: <20221108142226.63161-1-andriy.shevchenko@linux.intel.com> <20221108142226.63161-7-andriy.shevchenko@linux.intel.com> <20221110074456.hgmu7d5mn5kndc66@pengutronix.de> In-Reply-To: <20221110074456.hgmu7d5mn5kndc66@pengutronix.de> From: Andy Shevchenko Date: Thu, 10 Nov 2022 12:03:35 +0200 Message-ID: Subject: Re: [PATCH v2 6/6] pinctrl: intel: Enumerate PWM device when community has a capabilitty To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Andy Shevchenko , Mika Westerberg , Hans de Goede , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, Andy Shevchenko , Linus Walleij Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 10, 2022 at 9:45 AM Uwe Kleine-K=C3=B6nig wrote: > On Tue, Nov 08, 2022 at 04:22:26PM +0200, Andy Shevchenko wrote: > > Some of the Communities may have PWM capability. In such cases, > > enumerate PWM device via respective driver. User is still responsible > > for setting correct pin muxing for the line that needs to output the > > signal. ... > > + pwm =3D pwm_lpss_probe(pctrl->dev, community->regs + PWMC, &info)= ; > > + if (IS_ERR(pwm) && PTR_ERR(pwm) !=3D -ENODEV) > > + return PTR_ERR(pwm); > > Linus and Andy already agreed that this patch is ugly. I wonder if this > here would be a bit less ugly if you do: > > if (IS_REACHABLE(...)) { > pwm =3D pwm_lpss_probe(...); > ... > > > } > > and drop the check PTR_ERR(pwm) !=3D -ENODEV (which might have a differen= t > semantic than "the pwm driver isn't available"). I will think about it (in such case the comment against the previous patch makes more sense to me). Thank you for the review! --=20 With Best Regards, Andy Shevchenko