From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2929C3065A for ; Mon, 1 Jul 2024 16:15:02 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Wt7x4A2Q; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WCWN53Tldz3fTj for ; Tue, 2 Jul 2024 02:15:01 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Wt7x4A2Q; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::232; helo=mail-lj1-x232.google.com; envelope-from=sergei.shtylyov@gmail.com; receiver=lists.ozlabs.org) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4WCWMF2fmJz30T0; Tue, 2 Jul 2024 02:14:15 +1000 (AEST) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2eabd22d3f4so31661191fa.1; Mon, 01 Jul 2024 09:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719850449; x=1720455249; darn=lists.ozlabs.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=N9eJvY3noQUZfbyZhFkyxOik2OAqPtae0XwqIwzXsH8=; b=Wt7x4A2Q5RG21NEXORdJ80zgqccYQZHgJhXthxUiVdJZBzLSHI4ktvqqk7GgKbab3w WsbhYlH7aBeOos0D+GJ/mxTZKfamtszB2qKfSH3a2IWyAsMOfoY+L5QFrFHd/I+XqgFn 5kXFGD2R13Boj1Yk8Bx99S5KW03BygzoA9XYkSV96w9/ykymYIZnlZm08xQ8UqY1mQqO 6iXzzoM1ko6QrcW2WMQ1CZJAb9t3+m6AnaahcCoJgrh/ikcD/wn2BUP+z7Tv64hTp2yT suEcmy7py9HUIFMyK5k0OyOHDyRfdXyitRWYkgXgj0LW8/+/wS35+DQ4Nkxv1emXaH1N kBGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850449; x=1720455249; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N9eJvY3noQUZfbyZhFkyxOik2OAqPtae0XwqIwzXsH8=; b=UWgIkozgidZUB7aRSNA+C5Olr9CPyo6XJEIP66B+S+o/kn9pyEC5CwPJvt3mLUVtZ2 W6Ae7LnehegN9a0lgmIl11yTdHy1voJL7pKglyZoWOEr7hvIAkT9ooLV++a6rf79uTtE NM9G8yMzVAczh+FsWCsAeFNAs8yzsLWQWShUX+Wvy5bvV3MU1Dzz1/WML+B/g3x8i9M1 j6gVl7TeZ18Fq/6Apo+RSZO+YcdgiQ1wJBhHpkkuiVwlp5uGz6n8gVPrz9SSR96L+h8b qby6c7EajKjgXUjzeYgBpPSnBX5S5QmZQaTYYP0IZrlR9aqbqQm54vi43SHwPorJtga6 V/4g== X-Forwarded-Encrypted: i=1; AJvYcCWzzESAgeB1K3fwr4mCvSSK/a5oPEN4W4YfoETqYCn22us6G/0X0YbJf1LNu5vVTA/x576KmwxKpkwgCxfrQsQwe/33QWuG9L+/veQg/kAXetxaoKHh8k74s9fM7OwpxI/qaGVtSG7iaT1Fpefsj9VOGovMpDHK1UZ6AeW+tSRZuPvAXCisnw== X-Gm-Message-State: AOJu0YyNGgAOcWT89oPjGD4HLzpYTgQyQMhlzS6B+uYTonxx7xlzvCFQ 0Y8w72ZqME5n17xq7lDuBNAOxPMNT3RjuQQYIC0AyZmy0e1MA7zy X-Google-Smtp-Source: AGHT+IHHz/OamA1Ukx5sIFBlK+L0AmnL9jrrDHysPJKMb3Xyg4pOUjtzhB1j4PXHUjwphZM6xFX6sw== X-Received: by 2002:a2e:8558:0:b0:2ec:5382:2703 with SMTP id 38308e7fff4ca-2ee5e6f6972mr34830361fa.53.1719850448585; Mon, 01 Jul 2024 09:14:08 -0700 (PDT) Received: from [192.168.1.105] ([178.176.75.203]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ee516803aesm14192571fa.79.2024.07.01.09.14.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Jul 2024 09:14:07 -0700 (PDT) Subject: Re: [PATCH 2/9] mtd: add mtd_is_master helper To: Marco Felsch , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Arnd Bergmann , Greg Kroah-Hartman , Bartosz Golaszewski , Russell King , Joel Stanley , Andrew Jeffery , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Vladimir Zapolskiy , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Tony Lindgren , Geert Uytterhoeven , Magnus Damm , Dinh Nguyen , Thierry Reding , Jonathan Hunter , =?UTF-8?Q?Jonathan_Neusch=c3=a4fer?= , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , Thomas Bogendoerfer , Huacai Chen , WANG Xuerui References: <20240701-b4-v6-10-topic-usbc-tcpci-v1-0-3fd5f4a193cc@pengutronix.de> <20240701-b4-v6-10-topic-usbc-tcpci-v1-2-3fd5f4a193cc@pengutronix.de> From: Sergei Shtylyov Message-ID: Date: Mon, 1 Jul 2024 19:14:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20240701-b4-v6-10-topic-usbc-tcpci-v1-2-3fd5f4a193cc@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: imx@lists.linux.dev, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, loongarch@lists.linux.dev, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 7/1/24 4:53 PM, Marco Felsch wrote: > Provide a simple helper to make it easy to detect an master mtd device. > > Signed-off-by: Marco Felsch > --- > include/linux/mtd/mtd.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h > index 8d10d9d2e830..bf3fc2ea7230 100644 > --- a/include/linux/mtd/mtd.h > +++ b/include/linux/mtd/mtd.h > @@ -408,6 +408,11 @@ static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd) > return mtd; > } > > +static inline bool mtd_is_master(struct mtd_info *mtd) > +{ > + return mtd->parent ? false : true; Perhaps: return !mtd->parent; [...] MBR, Sergey