Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2176933imj; Sun, 10 Feb 2019 20:54:59 -0800 (PST) X-Google-Smtp-Source: AHgI3IbXyNs5XcKchN0rfuDbwGj3HwxAvkkPHVu1QIa+q3vIfsxnu8qHYDdTeCXarCol/1K66Z8E X-Received: by 2002:a17:902:bd0a:: with SMTP id p10mr34773511pls.322.1549860899737; Sun, 10 Feb 2019 20:54:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549860899; cv=none; d=google.com; s=arc-20160816; b=crKgk5K91ynGUO88GOCJ38kjvbfZi0DrnKWl38LjNzz6G4DwRs/0+kJMVPY4pVPMSz WVcLcNWfD/l/lg0M2cHeWNioYmgTJu6q6njT5qPhB7B/IZ4cI9eCs8YarwtBnS+45kNY QHvSr9v4O+EQShj/flEG86AbW62nyq24fEoMa86LpB0eF+9o3gOnrICvDaHiIEz08dpa xCPnRpvfqsapmRMouRjUIgjBPht8+qExPSeFB4WRlx2NMJUH9WPCxMqsq+Lk9L1hDSDN 6yEjIIeuIBsJzCrVtjO7gaLuHhnn9QA2hQtyI+WpCDtDGZg12w1k2YAMctgnMtAmQ2Ge MFoQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=TtFnIV9B2FuN7s37b6pmhfZ5UAL4/FpSlIfLtJpA2sQ=; b=EhEm4su/Y+Z22zdF7ZN+TjyFCRgpndQ+HCbHt+IOYqYKxxsMI+3CrXc1t1EtcUPEDL ZSox9E2KaeNuMUWkvo8o6pDueIHGLZuSB15k8SoJlkfeBybzvZIh1LvFQJyHpdUmWC2A k7YizAtX52MuNZOYwUOd1+YVbwQE3lBWq3h23WjFvAx2H3JBGe5EMro9cTe8JDNP7Xgh Ii49vLPaAibbxY6ivEAXbEuFaenvSc9kb8Bx8L8fOryRMSNNONx8lPPk/w4WN0hS01pz q4jWNUSgLyZyw8feDGPXdYB9tYGV9+ndfOAohmY0hG/WCF9v2NwYexOEgfmUD/ThgCtU JUZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="lgwIc/S4"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y24si6088780pgf.555.2019.02.10.20.54.43; Sun, 10 Feb 2019 20:54:59 -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=@ti.com header.s=ti-com-17Q1 header.b="lgwIc/S4"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbfBKExA (ORCPT + 99 others); Sun, 10 Feb 2019 23:53:00 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:41052 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbfBKExA (ORCPT ); Sun, 10 Feb 2019 23:53:00 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x1B4qlpv066476; Sun, 10 Feb 2019 22:52:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549860767; bh=TtFnIV9B2FuN7s37b6pmhfZ5UAL4/FpSlIfLtJpA2sQ=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=lgwIc/S4rchC9OqGcxRKWECSYTC+r0h82JAvSF6bc4X3ABoAho14j/9NwT0AEVmO7 Xx1WMVBmtY+f/80HeQsYRc9VSOkrhok9I04ix5zSsYGjzlwa3HoN85Ot52YlqpmxO4 7rZwkQ4cgUbj6uKxKDvr+InOdyPiDD4zQ9rXEdg4= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x1B4qllA069564 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 10 Feb 2019 22:52:47 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sun, 10 Feb 2019 22:52:47 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Sun, 10 Feb 2019 22:52:47 -0600 Received: from [172.24.190.89] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x1B4qhYu017341; Sun, 10 Feb 2019 22:52:45 -0600 Subject: Re: [PATCH v5 2/2] mtd: spi-nor: cadence-quadspi: Add support for Octal SPI controller To: Boris Brezillon 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" References: <20190128054935.4972-1-vigneshr@ti.com> <20190128054935.4972-3-vigneshr@ti.com> <2efbca08-c4ab-34ea-0e34-05aed7168df8@microchip.com> <20190210141912.1da19db6@kernel.org> From: Vignesh R Message-ID: Date: Mon, 11 Feb 2019 10:23:42 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190210141912.1da19db6@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/02/19 6:49 PM, Boris Brezillon wrote: > 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). > Ok, will respin with a dev_err() and return -EINVAL when ddata is NULL. -- Regards Vignesh