From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751386AbcFRMeI (ORCPT ); Sat, 18 Jun 2016 08:34:08 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44723 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750879AbcFRMeH (ORCPT ); Sat, 18 Jun 2016 08:34:07 -0400 Subject: Re: [PATCH v2 05/15] mtd: nand: add manufacturer specific initialization/detection steps To: Boris Brezillon References: <1465390849-13199-1-git-send-email-boris.brezillon@free-electrons.com> <1465390849-13199-6-git-send-email-boris.brezillon@free-electrons.com> <576512F5.7050506@nod.at> <20160618133454.38fc8fd9@bbrezillon> Cc: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, Hans de Goede , linux-kernel@vger.kernel.org, Aleksei Mamlin From: Richard Weinberger Message-ID: <57653FB8.2060006@nod.at> Date: Sat, 18 Jun 2016 14:34:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160618133454.38fc8fd9@bbrezillon> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 18.06.2016 um 13:34 schrieb Boris Brezillon: > On Sat, 18 Jun 2016 11:23:01 +0200 > Richard Weinberger wrote: > >> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c >> index 55f3ab8..aadebe7 100644 >> --- a/drivers/mtd/nand/nand_base.c >> +++ b/drivers/mtd/nand/nand_base.c >> @@ -3703,6 +3703,10 @@ static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type) >> >> chip->manufacturer.ops = nand_manuf_ids[maf_idx].ops; >> >> + if (!chip->manufacturer.ops) >> + /* assign no operations */ >> + chip->manufacturer.ops = nand_manuf_ids[0].ops; >> + > > BTW, this is wrong, the manufacturer id code is not the index of the > nand_manuf_ids[] table ;). If we go for this option, we should probably > declare no_ops in nand_base.c and assign it here: > Oh, yes. You are right. Anyway, I think having a wrapper is also a good solution. Thanks, //richard