Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2612474pxb; Thu, 10 Feb 2022 01:17:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzINNmZZGDM0G1j4/2GFcfmL4xaFad3JFsuTUmZ4BkTA3TWxnGZW5DNzmdjXC5PTxS1SyIT X-Received: by 2002:a17:906:4787:: with SMTP id cw7mr5708145ejc.504.1644484658904; Thu, 10 Feb 2022 01:17:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644484658; cv=none; d=google.com; s=arc-20160816; b=b8gLTVexehR9k1oLfqSFlmksFINmLh21IRQEyshtySqAscQEjdUCXAhLFztJS4B9jB M/E+hBmzDOecayeGwcIpAd6zhV9251ZhpAYWyAYhWAfYEp4b577DNpQhDVXZs2j9yAOu TXOt4GHwXDy8xFQy/uJkFf0TipY4JWn/qvCKOEcwKhiI+SSLZqTqB8TBVpGIubFNrB/O b3GBguwL27pSzkmTZkV624n8Io2RmT54FAmVoLEpqWLdZR8c2YK/cfh32Mpj6cqQFh30 nHD77ZoNifbrIaDoq0HvoNm5vyDHvYIKCk6w9OGAgbqRH2KD1jdpEiZDZ/SeSsGWXzID vdzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=f/wqfZ7Tr1j9aSdCRb6UxeY6aGR1bPLimuxomNP4AWQ=; b=OYmVg+Rv/I0FzxIqZaJskCc8U3MOWWclKY3p510Khn/bwTCpZqKCuNZeyAKmBcMRKH L76EVcmkEaKcWpBaWeJedO4g3GfA7OYTXuuIkPyOq7bi6sul91IN1JArrHPLQu7EgKiH X5gioJj8SQ2Sei48mBUFLND4pHCR9aoAgi4BPKbShXRU2CzoIeT5F9aUxjLpGyYU0D2C xq9KtBe2o6TAdq2RWF+ZESdfKuoASl48cvrOpQHWwmtmog/aWSVON7h7cmlA1nnc1usJ nnbP0eSVPoMRXklRqMre3JfbseuniumLmZ0HCOfEdNWyDMZyrdXyqxB3opxARW4n+4Gg /wLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=DIkgjIue; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb24si4669076ejc.88.2022.02.10.01.17.12; Thu, 10 Feb 2022 01:17:38 -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=@walle.cc header.s=mail2016061301 header.b=DIkgjIue; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236896AbiBJIBp (ORCPT + 99 others); Thu, 10 Feb 2022 03:01:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234323AbiBJIBo (ORCPT ); Thu, 10 Feb 2022 03:01:44 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 220121088 for ; Thu, 10 Feb 2022 00:01:44 -0800 (PST) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 924112223A; Thu, 10 Feb 2022 09:01:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1644480101; 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=f/wqfZ7Tr1j9aSdCRb6UxeY6aGR1bPLimuxomNP4AWQ=; b=DIkgjIue5Cuw5V1TANoCyK23hr+AMqR+LeQLRZd5aglf77JppssV8wm8LBHnvv5akISPrd xjHkI/PRZ7Zo7I7Erxswr67nxpdG4pymxpkolZCsGNnphd3W9Y15lsAvQR8SXwbKLsufsZ 0PIx1UjLjieWSA6Dx6wxMNgflIisecY= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 10 Feb 2022 09:01:39 +0100 From: Michael Walle To: Tudor.Ambarus@microchip.com Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, p.yadav@ti.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Subject: Re: [PATCH v1 02/14] mtd: spi-nor: slightly refactor the spi_nor_setup() In-Reply-To: References: <20220202145853.4187726-1-michael@walle.cc> <20220202145853.4187726-3-michael@walle.cc> User-Agent: Roundcube Webmail/1.4.12 Message-ID: <0280538304fe8c837af0356ae469f428@walle.cc> X-Sender: michael@walle.cc X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, 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 Am 2022-02-10 04:00, schrieb Tudor.Ambarus@microchip.com: > On 2/2/22 16:58, Michael Walle wrote: >> EXTERNAL EMAIL: Do not click links or open attachments unless you know >> the content is safe >> >> Instead of always using a function pointer (and initializing it to our >> default), just call the default function if the flash didn't set its >> own >> one. That will make the call flow easier to follow. >> >> Also mark the parameter as optional now. > > what should be done in the future? What do you mean? IMHO the default path should be visible in the function. Eg. int spi_nor_bla(nor) { if (nor->some_exceptional_cb) return nor->some_exceptional_cb(nor); return usual_cb(nor); } -michael