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=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 8C71AC433DF for ; Tue, 28 Jul 2020 09:47:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 726F120786 for ; Tue, 28 Jul 2020 09:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728345AbgG1Jr0 (ORCPT ); Tue, 28 Jul 2020 05:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728050AbgG1Jr0 (ORCPT ); Tue, 28 Jul 2020 05:47:26 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E732CC061794 for ; Tue, 28 Jul 2020 02:47:25 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0MCf-0006Wm-VV; Tue, 28 Jul 2020 11:47:21 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1k0MCe-00025Z-98; Tue, 28 Jul 2020 11:47:20 +0200 Date: Tue, 28 Jul 2020 11:47:20 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Michael Walle Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Bartosz Golaszewski , Rob Herring , Jean Delvare , Guenter Roeck , Lee Jones , Thierry Reding , Wim Van Sebroeck , Shawn Guo , Li Yang , Thomas Gleixner , Jason Cooper , Marc Zyngier , Mark Brown , Greg Kroah-Hartman , Andy Shevchenko , Catalin Marinas , Will Deacon , Pavel Machek Subject: Re: [PATCH v6 06/13] pwm: add support for sl28cpld PWM controller Message-ID: <20200728094720.x6pucwxsfwvz6nvv@pengutronix.de> References: <20200725231834.25642-1-michael@walle.cc> <20200725231834.25642-7-michael@walle.cc> <20200728074352.ckyfso5zwsfgupjx@pengutronix.de> <58b53cacc5289f17f669159beeeada03@walle.cc> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="htulbp2bdc2ny5pv" Content-Disposition: inline In-Reply-To: <58b53cacc5289f17f669159beeeada03@walle.cc> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-hwmon@vger.kernel.org Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org --htulbp2bdc2ny5pv Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hallo, On Tue, Jul 28, 2020 at 10:21:22AM +0200, Michael Walle wrote: > Am 2020-07-28 09:43, schrieb Uwe Kleine-K=F6nig: > > On Sun, Jul 26, 2020 at 01:18:27AM +0200, Michael Walle wrote: > > > +static int sl28cpld_pwm_probe(struct platform_device *pdev) > > > +{ > > > + struct sl28cpld_pwm *priv; > > > + struct pwm_chip *chip; > > > + int ret; > > > + > > > + if (!pdev->dev.parent) > > > + return -ENODEV; > > > + > > > + priv =3D devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); > > > + if (!priv) > > > + return -ENOMEM; > > > + > > > + priv->regmap =3D dev_get_regmap(pdev->dev.parent, NULL); > > > + if (!priv->regmap) > >=20 > > Error message here? >=20 > This shouldn't really happen and I put it into the same category > as the two above and report no error. But I can add it. For kzalloc it is right to not emit an error because a failing kzalloc is already loud on its own. I missed the first error path, that should get a message, too. > Generally, it looked to me that more and more drivers don't > really report errors anymore, but just return with an -EWHATEVER. > So if someone can shed some light here, I'm all ears. IMHO it's wrong not to add error messages. At one point in time it will fail and then you're happy if you don't have to add printks all over the place first to debug that. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --htulbp2bdc2ny5pv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl8f9CUACgkQwfwUeK3K 7AlkpAf9GX/MdqMREp3J4dX8H7TLp3wVx7/FOTFnrRDTkszIftG16IG7J9g1qiyY lN54gRXDEtuTo7PfeKcJ09lh/jT2xRPE/Y6kHSW6BQKNw2C0S74Pv2UMc1aYWsvZ GlE/2BL1tB7F7+OLVIFRhL5N5O0QKaBO5bxaC/DKd4ZAnvbLPloAcysP0kHzqvXP H72qdOstHSP5znm4z6+Vcb7xiI9XiT9GWgnumpwo1f6s58SEGsbQUiLRLXIkRURN LKzxXtqSMbW1n+U34jSgI6BI+wyDAGQz0iJ0WxKV6DUa5IO7IqucION92J9s7w32 ntP5cEULmXHKeTvOGXgM59juqdxEtg== =KNkY -----END PGP SIGNATURE----- --htulbp2bdc2ny5pv--