From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751335AbcFRLe7 (ORCPT ); Sat, 18 Jun 2016 07:34:59 -0400 Received: from down.free-electrons.com ([37.187.137.238]:43767 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751007AbcFRLe6 (ORCPT ); Sat, 18 Jun 2016 07:34:58 -0400 Date: Sat, 18 Jun 2016 13:34:54 +0200 From: Boris Brezillon To: Richard Weinberger Cc: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, Hans de Goede , linux-kernel@vger.kernel.org, Aleksei Mamlin Subject: Re: [PATCH v2 05/15] mtd: nand: add manufacturer specific initialization/detection steps Message-ID: <20160618133454.38fc8fd9@bbrezillon> In-Reply-To: <576512F5.7050506@nod.at> 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> Organization: Free Electrons X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: chip->manufacturer.ops = nand_manuf_no_ops; > if (!type) > type = nand_flash_ids; >