Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1865036rwb; Fri, 19 Aug 2022 10:40:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR4uo7CK3QPY4rQLFUNiqLAiHrhAU8sqvWtGf3PJf64YMQpkEyY7VYk0Rm4D146RbQu8Zo85 X-Received: by 2002:a63:2a44:0:b0:41d:9296:406 with SMTP id q65-20020a632a44000000b0041d92960406mr7142252pgq.190.1660930805280; Fri, 19 Aug 2022 10:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930805; cv=none; d=google.com; s=arc-20160816; b=ezLp/kaG+vA9oi99oxhaAkEjeYL4goJPhTd5miiwMG6iY9s+G+D/y0KdpDX27mBSZh ECfuIFHkDIfQTcbp8V3eKGV+Er+iuRJlRJZ8CHeOt5YdWcWasdQ5vda/Hz5snF+d0JNi O4JNGfKr4zXTg3+qCclz7E0uu2gNR5IIIArFKiKxwAfRhrsV9ivUXCsif12d1Sacs3J4 a+XrQr6IC14G1EWsfnesjP2jKR2QwwVlgaz1TDaOLDZT1ZT1mLTYCq30POEHNKHBLvPV 2TOdVOpYBrx9IQyWkSaWm2t6O79iw61a/5cDxVViSIGlNMp1Xjy3xcmV0cOpsQforrex YHFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3oxm2fTSEt+cAqY6YIAGMLW/S57oFlZgLUlSzFLYIwY=; b=OK9FNAgQh/+2fVWw9wOxbMiyT85o5CutCAe15p0LgwXe2us1vU0o2Yc0zmyycB6cbr GCptmOAehI86k/eufthpykmRlyMzNF710hZHtXlDVOvuKXwf4XQPcZbFuIDoaOdlX/l7 O1cnHHuElDcd4MCVHOL1KEYpwMyGwGX67IdV4lfze7WJqo9dI9ADqIo5s+PfW6ZNOHUw qsx2dG8Q0I6GE6qfo77f4FeEpFGVHut+ndKqGw+MX8bIAokWOD/kuY+JyIaEJGeGixdS pEUr4BQp0nDHhR7VAvx83981BXtzE82oVvjnyQh9tTpdB9iRuXDP1SMdYkzBKrLLMXsO O8YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W2FwpgEV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a056a00134900b0052e525cc159si5234756pfu.160.2022.08.19.10.39.54; Fri, 19 Aug 2022 10:40:05 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=W2FwpgEV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353807AbiHSQoU (ORCPT + 99 others); Fri, 19 Aug 2022 12:44:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354022AbiHSQlb (ORCPT ); Fri, 19 Aug 2022 12:41:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB88D12844B; Fri, 19 Aug 2022 09:10:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 456D9B82826; Fri, 19 Aug 2022 16:08:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CAC9C433C1; Fri, 19 Aug 2022 16:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925335; bh=VZBqk/YBd786B+HpOYTIMwbhmJyz3N1sfksTkvq66aU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W2FwpgEV4DIZEl8oshCMHD82ebxt4t6i+569fWh7PZR2vNjfkF9prnY5CMVrHw4Fk ZMeohQ20RltaIxXUyGvw7til55MkhE/cLi9XLU2uBi5qUP9b0lfvnQsgRuE+3Vi031 veFZUJ+c3WHio6byYCD5JtmUX9a8G99omLRSl2nU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Sasha Levin Subject: [PATCH 5.10 458/545] mtd: rawnand: Add a helper to clarify the interface configuration Date: Fri, 19 Aug 2022 17:43:48 +0200 Message-Id: <20220819153849.875336174@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Miquel Raynal [ Upstream commit 961965c45c706175b24227868b1c12d72775e446 ] Name it nand_interface_is_sdr() which will make even more sense when nand_interface_is_nvddr() will be introduced. Use it when relevant. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210505213750.257417-2-miquel.raynal@bootlin.com Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +- include/linux/mtd/rawnand.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c index c048e826746a..2228c34f3dea 100644 --- a/drivers/mtd/nand/raw/atmel/nand-controller.c +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c @@ -1246,7 +1246,7 @@ static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand, nc = to_nand_controller(nand->base.controller); /* DDR interface not supported. */ - if (conf->type != NAND_SDR_IFACE) + if (!nand_interface_is_sdr(conf)) return -ENOTSUPP; /* diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index db2eaff77f41..75535036b126 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -499,6 +499,15 @@ struct nand_interface_config { } timings; }; +/** + * nand_interface_is_sdr - get the interface type + * @conf: The data interface + */ +static bool nand_interface_is_sdr(const struct nand_interface_config *conf) +{ + return conf->type == NAND_SDR_IFACE; +} + /** * nand_get_sdr_timings - get SDR timing from data interface * @conf: The data interface @@ -506,7 +515,7 @@ struct nand_interface_config { static inline const struct nand_sdr_timings * nand_get_sdr_timings(const struct nand_interface_config *conf) { - if (conf->type != NAND_SDR_IFACE) + if (!nand_interface_is_sdr(conf)) return ERR_PTR(-EINVAL); return &conf->timings.sdr; -- 2.35.1