Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1565849imj; Sun, 10 Feb 2019 05:22:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IaGYim2ig3pEysxXHO5gS4HsQpbczoNdMkzZ0z8ML4xhxrZlubSsSLodejvtxcN+ydb0Jq6 X-Received: by 2002:a65:5bc4:: with SMTP id o4mr29636863pgr.426.1549804945638; Sun, 10 Feb 2019 05:22:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549804945; cv=none; d=google.com; s=arc-20160816; b=Rj9l0g9LrYQKVC1JNBlWWamKWte3x2G9D9TIw3BASrmmhdF5ddu6O/G+5NUJbfemlT KTHk1pQDONlo3OScmo1MwW4CZ5EpnkrZIhA/NISDO5MM42GOz7diat21+kZex5NVoyY8 QGiBtzZBXKL59lseouEVnkN1HcX4Cput3t+fuEEhdei6YtwIRs/vo0IwDDOKFGSKXMRZ Axd47Otgolwwctkdh04MH3/HZTgqs/SBIwEior/U6sf9YFY85FJ13KQ4ljOwuY3AvFXq goOHqd7nIJMd7ECuRMznsIzSePbDNImAKJsE7S7eOPaeS2jGcKVMxbZ/Pu0vM3ecOFOg Qqhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=1RMOzBOIz6TD9XZGfq5xYNLPz8Jh7jalYY5OPVgkiBc=; b=SUGz/LVUTlgRzXH12iq7LVRzTUVpEcYWCzsQT1wEbalV3Ure+1Xk60mlofT2/k9f51 +XxqjYXD/M9+5rlGi5wR6cwgSlKpPZl2lEI23GpejmEMY/UiDV/qOqb7GU/dTu/YnXlR 3GBSVhlS10hf3rzsu6xyUQ2V0KOieW9CHYepbTERUFpdgbCNULTWlAvMwZ/PIC4gZpOW 7nVxar7e5aVrLMdeCikJzLxOyYZ6qUNVcSgLHQq22trj1JYwLzuErb5wF6zG36GRQcv7 Cxi5mO8It2zij6f3rXv8Z1iKbda6brdqjj4upl/TSAjU4qwMGDXzOKSry2xmeYVTPW+J gtrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hZW838DE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b128si8414211pfa.283.2019.02.10.05.21.54; Sun, 10 Feb 2019 05:22:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hZW838DE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbfBJNTW (ORCPT + 99 others); Sun, 10 Feb 2019 08:19:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:59012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbfBJNTV (ORCPT ); Sun, 10 Feb 2019 08:19:21 -0500 Received: from localhost (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B474B20823; Sun, 10 Feb 2019 13:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549804761; bh=343Y5jqNu9hTotntAX76szvN4bzQBg4yioPZQLl1+Hk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hZW838DEFimHjyCBKny2rCe6zbAb1MIEGUfJFFnyCN5Q9CtUql6IY2scXLADH4ITR vTGtRUIdsFA/XAxEBhcoLkfquR2ty9htGs8lKw/FWfvaRKrLUFRAqc0t4VjGdnEkfx P1xAyHp5LFvBbWPAeRJTQxNmM5E1zlHgWvCY3DKU= Date: Sun, 10 Feb 2019 14:19:12 +0100 From: Boris Brezillon To: Vignesh R Cc: "Tudor.Ambarus@microchip.com" , "marek.vasut@gmail.com" , "robh+dt@kernel.org" , "linux-mtd@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v5 2/2] mtd: spi-nor: cadence-quadspi: Add support for Octal SPI controller Message-ID: <20190210141912.1da19db6@kernel.org> In-Reply-To: References: <20190128054935.4972-1-vigneshr@ti.com> <20190128054935.4972-3-vigneshr@ti.com> <2efbca08-c4ab-34ea-0e34-05aed7168df8@microchip.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Feb 2019 11:43:46 +0530 Vignesh R wrote: > >> static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) > >> { > >> - const struct spi_nor_hwcaps hwcaps = { > >> - .mask = SNOR_HWCAPS_READ | > >> - SNOR_HWCAPS_READ_FAST | > >> - SNOR_HWCAPS_READ_1_1_2 | > >> - SNOR_HWCAPS_READ_1_1_4 | > >> - SNOR_HWCAPS_PP, > >> - }; > >> struct platform_device *pdev = cqspi->pdev; > >> struct device *dev = &pdev->dev; > >> + const struct cqspi_driver_platdata *ddata; > >> + struct spi_nor_hwcaps hwcaps; > >> struct cqspi_flash_pdata *f_pdata; > >> struct spi_nor *nor; > >> struct mtd_info *mtd; > >> unsigned int cs; > >> int i, ret; > >> > >> + ddata = of_device_get_match_data(dev); > >> + if (!ddata) > >> + hwcaps.mask = CQSPI_BASE_HWCAPS_MASK; > > > > Now that .data is set in all cqspi_dt_ids[], maybe it's better to print a > > message and return an error here. But I guess it's a matter of taste, so not a > > show stopper. > > Since, driver data is kernel internal field, I guess there is little > help in printing out the error to the user when its missing. I prefer to > keep this as is, as basic Quad mode is supported by all versions of the IP. Well, if all compat entries have an associated platdata instance we don't need to support the !ddata case, right? I think enforcing the presence of such a platdata is actually is a sane thing to do (which implies returning an error when ddata is NULL).