Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3869389rwd; Sat, 3 Jun 2023 13:56:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64IRqhHFvse8DFqimWS3qN/xqX9usWzAUdXw7z1VDz5X5IacKQnvP6VI6/49c9MbQQ9UOX X-Received: by 2002:a0d:e88a:0:b0:565:ba08:12b6 with SMTP id r132-20020a0de88a000000b00565ba0812b6mr5131705ywe.17.1685825766895; Sat, 03 Jun 2023 13:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685825766; cv=none; d=google.com; s=arc-20160816; b=0O2UzDQpFgZ80FqnnyxZ0JP1CTFf991kHlhLdM5rIih3/ei1uVShCPFNSUDsU9Ta5S mQT/RqPuNItGB+I1gPnqQqOnonE9Xl6hfNipy/je4D3pu9qDIyJooki6pecjtpxMdI03 mY+V+oJz0o9EsOC+3tf6mmjmWHiGjLsdjhVZP5lF9Azg0+zOifcpnCZSkvSf32Y2MoGD A7lV4q4W50t3GDV4Bydg1IqGM3/tfi8rahn0wCfElo/32uuvhy/tep8msCnDqZrPUP6N uavJAtTjstF8uiGBXRGwiQA2m1I9S3iP+CdQg6mXCcWMuHa9ByPulkArFIJ//9sFfWid odNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=ukHxHL87WSax839VFfYtSioahzS/MSQz95kiun2xnWk=; b=dbK6pTbrOocxeTXsC3q0z9Xi8+HJ7/l8Dj/Mkmsk93BYYqKrhcms8MxJWq9gldximL A1ARLy4l1Eu5qn4VhVx7AlCgKF2E2MhlRf2gx424bTB1fgQ+ScWRI+WlJAJs8dZl9aXU fPDdhCgJZdcKXhMYd4a6nb9lVnn0OvsfanwhD7dPB2hGVTWK4edJuX46iP1Jk6Zt/0lz IE4ptYTOyADLgPs5a0gR6CWfFhq/GHV/2HcJ2C4rEdBq0DZusdrkTaZViAvxX+MKb8c5 iOO0BlMZ3DmE946OVDDBTYWQYXUkjo0Tt2gv6VnVDGYqv8gZlW3hnYdYDCMrmSUduTwu UBXw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 u11-20020a170903124b00b001ab1411f3e6si3128811plh.260.2023.06.03.13.55.54; Sat, 03 Jun 2023 13:56:06 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230416AbjFCUVD (ORCPT + 99 others); Sat, 3 Jun 2023 16:21:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbjFCUVC (ORCPT ); Sat, 3 Jun 2023 16:21:02 -0400 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0238E123 for ; Sat, 3 Jun 2023 13:21:01 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 25f5af74-024c-11ee-b972-005056bdfda7; Sat, 03 Jun 2023 23:20:58 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Sat, 3 Jun 2023 23:20:57 +0300 To: Nikita Shubin Cc: Alexander Sverdlin , Arnd Bergmann , Linus Walleij , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Jonathan Cameron , Stephen Boyd , Christophe Kerello , Jean Delvare , Liang Yang , Florian Fainelli , Michael Peters , Kris Bahnsen , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: Re: [PATCH v1 24/43] mtd: nand: add support for ts72xx Message-ID: References: <20230424123522.18302-1-nikita.shubin@maquefel.me> <20230601054549.10843-6-nikita.shubin@maquefel.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230601054549.10843-6-nikita.shubin@maquefel.me> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Jun 01, 2023 at 08:45:29AM +0300, Nikita Shubin kirjoitti: > Technologic Systems has it's own nand controller implementation in CPLD. > > This patch adds support for TS-72XX boards family. Use imperative mode, this is documented in the Submitting Patches, ... > +/* > + * Technologic Systems TS72xx NAND controller driver > + * > + * Copyright (C) 2023 Nikita Shubin > + * > + * derived: plat_nand.c Derived from: > + * Author: Vitaly Wool > + */ ... > +#include > +#include > +#include > +#include > +#include + Blank line? > +#include > +#include ... > + bits = readb(addr) & ~0x07; GENMASK()? ... > + addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE); BIT() ? ... > + return !!(readb(addr) & 0x20); BIT() ? ... > + struct ts72xx_nand_data *data; > + struct mtd_info *mtd; > + int err = 0; Redundant assignment. > + /* Allocate memory for the device structure (and zero it) */ > + data = devm_kzalloc(&pdev->dev, sizeof(struct ts72xx_nand_data), sizeof(*data) and make it a single line. > + GFP_KERNEL); > + if (!data) > + return -ENOMEM; ... > + nand_set_flash_node(&data->chip, pdev->dev.of_node); Hmm... wondering why this uses OF node instead of fwnode... But okay, this is question to the subsystem maintaners. > + err = mtd_device_parse_register(mtd, NULL, NULL, > + NULL, 0); There is plenty of space on the previous line. > + Redundant blank line. > + if (!err) > + return err; > + > + nand_cleanup(&data->chip); > + > + return 0; This seems at least weird and rather broken. To me it looks like if (err) { nand_cleanup(&data->chip); return err; } return 0; has to be here. > +} ... > + ret = mtd_device_unregister(nand_to_mtd(chip)); > + WARN_ON(ret); WARN_ON()?! Why? > + nand_cleanup(chip); > +} -- With Best Regards, Andy Shevchenko