Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2782502rwo; Mon, 24 Jul 2023 00:46:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSpuXvmAQmknUFJ/zFVqzroDAW/CO4NVYyjVajjRBHDlcdG0cMbW9FnkbtL1HWSBaRh0ba X-Received: by 2002:a50:fb08:0:b0:521:e544:e7 with SMTP id d8-20020a50fb08000000b00521e54400e7mr7440843edq.6.1690184812847; Mon, 24 Jul 2023 00:46:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690184812; cv=none; d=google.com; s=arc-20160816; b=WBbg0aoqOhbd0gGcjuJHmeFHaVvBzaPw349F6hQmxIIDnxKfjHtimtYBDiBrdhP/hO TdvPiVEF9Dxurp8jeTxpTJTuNPAf9Fr0ZWPXj23/FwNtQRsQMnCfEMMSrxjAy/uN46JH T+epU/Q0Xm84QJu9Z0HOGIFNaZ4atra3gwaayZrnPie7mIvXQSzrZsFLz1pFcuL8Q77F O0HkiJBOVvTQWrbTYGp6rJwS8thnal4lvCOdEJZGeG9tRAv6Af8jf5MC/awAUgopQ7LG 6anJpQE2Wg84fOHFhnSnyT33UHcTPtBDmvrYXE4L0S3yfBdnXiFNYzBseRqKsUdgQ9e+ CIDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=0OTdgWQ6Vo/4tl1ZM7En0YdjITPLKGIP2IIxkkPFJRM=; fh=zpGCJIuWcKqEOPRO6d5RqesS1IblaeEqZaYnP1+LKAE=; b=o/df4rcHznb4/VtLuXVQy10vhuWm8qbtK3djL6S2bvicNrl4YZA/+k6UXeHATgqsRI dLS4mG0Te0xvqVt7H3UPom3BMaTWyYmHdkRvnoFzw7YYaPkojjh4BKJQzNwq9fFyJVzQ t76/iaFXbjqTaooKtcWDPqF0oXSXddn569T45VO2DSVJEyI5EV+0hycwbbtZt2O6pvgl lsmdM26u0kyZ8299IuO33q2I9gneVkeMjUCUjJYoy943C9B4TVcrE/1m8k6NvL59xHBe vBj0P5qPTUUyd3/UTOBt9xSvi5PEZv5QOFntlOEP8KHm8HrqACLhKrXnef48IFZQ70kl Sfdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=iC5ZIY44; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r18-20020aa7cfd2000000b005223181e519si743116edy.230.2023.07.24.00.46.28; Mon, 24 Jul 2023 00:46:52 -0700 (PDT) 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=@bootlin.com header.s=gm1 header.b=iC5ZIY44; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230300AbjGXHJV (ORCPT + 99 others); Mon, 24 Jul 2023 03:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjGXHJT (ORCPT ); Mon, 24 Jul 2023 03:09:19 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B22C6138; Mon, 24 Jul 2023 00:09:14 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6C2E524000E; Mon, 24 Jul 2023 07:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690182552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0OTdgWQ6Vo/4tl1ZM7En0YdjITPLKGIP2IIxkkPFJRM=; b=iC5ZIY44VFrCSUNoeMIdYmOyqSrlrW7N4tyY+Hq53oXBVph3jCQ5ij8fsDynsYh6NybKfF 47iBUwR964ggu52YB13yaU1E18wok2aDQAXdbpXfZnCVzqeybMcvNBEm04M8MJv49vz912 60p20TKBhztddQMV6EZbSo0vTLzFb3Ok+FWErn92iDiDFjDyPmqRh1JKdYw5xT3hwpwVlV u4k2GthKUnBFuRNrRP/XoPSerupU1HIaiVySzO/QpWk35FaiLI3dwdIhQ2brWGTyOPPUCM 8E3/Ier83smwYkYCv/LsZ20OWFpB5I2g8A5epoX659Pa/Omr3Rckh60nqnZ+5A== Date: Mon, 24 Jul 2023 09:09:02 +0200 From: Miquel Raynal To: Andy Shevchenko Cc: nikita.shubin@maquefel.me, Hartley Sweeten , Lennert Buytenhek , Alexander Sverdlin , Russell King , Lukasz Majewski , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Daniel Lezcano , Thomas Gleixner , Alessandro Zummo , Alexandre Belloni , Wim Van Sebroeck , Guenter Roeck , Sebastian Reichel , Thierry Reding , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , Mark Brown , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Sergey Shtylyov , Dmitry Torokhov , Arnd Bergmann , Olof Johansson , soc@kernel.org, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Michael Peters , Kris Bahnsen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-pm@vger.kernel.org, linux-pwm@vger.kernel.org, linux-spi@vger.kernel.org, netdev@vger.kernel.org, dmaengine@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, linux-input@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH v3 24/42] mtd: nand: add support for ts72xx Message-ID: <20230724090902.679ea56d@xps-13> In-Reply-To: References: <20230605-ep93xx-v3-0-3d63a5f1103e@maquefel.me> <20230605-ep93xx-v3-24-3d63a5f1103e@maquefel.me> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Andy, > > +static int ts72xx_nand_attach_chip(struct nand_chip *chip) > > +{ > > + switch (chip->ecc.engine_type) { > > + case NAND_ECC_ENGINE_TYPE_SOFT: > > + if (chip->ecc.algo =3D=3D NAND_ECC_ALGO_UNKNOWN) > > + chip->ecc.algo =3D NAND_ECC_ALGO_HAMMING; > > + break; > > + case NAND_ECC_ENGINE_TYPE_ON_HOST: > > + return -EINVAL; > > + default: =20 >=20 > > + break; =20 >=20 > Here it will return 0, is it a problem? Seems ok, there are two other situations: on-die ECC engine and no ECC engine, both do not require any specific handling on the controller side. >=20 > > + } > > + > > + return 0; > > +} =20 >=20 > ... >=20 > > +static void ts72xx_nand_remove(struct platform_device *pdev) > > +{ > > + struct ts72xx_nand_data *data =3D platform_get_drvdata(pdev); > > + struct nand_chip *chip =3D &data->chip; > > + int ret; > > + > > + ret =3D mtd_device_unregister(nand_to_mtd(chip)); =20 >=20 > > + WARN_ON(ret); =20 >=20 > Why?! Is it like this in other MTD drivers? Yes, we did not yet change the internal machinery to return void, and we don't want people to think getting errors there is normal. > > + nand_cleanup(chip); > > +} =20 >=20 Thanks, Miqu=C3=A8l