Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4014514ybz; Tue, 28 Apr 2020 04:22:45 -0700 (PDT) X-Google-Smtp-Source: APiQypJcibp7Ah5lb8NnWSQb9TxiPOrbnZETHmbErvhXdVzSdvZHL43AygS1vO/NXMUWxNmg/Kqb X-Received: by 2002:a50:f74c:: with SMTP id j12mr22331981edn.197.1588072965316; Tue, 28 Apr 2020 04:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588072965; cv=none; d=google.com; s=arc-20160816; b=ZauhFazvqhAYXBHPjiy3L/oTfqsuUUGZeLVWoOXcDdDeyTgISgc9KILn/NVORJBSjX qHuG8pd+c9jcnhCiolufmZyGNReOcHr4z0DZzoCKUSdWFJEy6OJMJbdtZOvJeY67iS1Q Dvk3ghNOibAMGmMmI9+Mg4YR/mHHqQUiLAN3zJ3G76jT07IeK9tueBc/VLKSnc+MwKj9 rSz6kCEXjSP5qMjZU/v1gMR/X6XzHH28BctlSKfKU8/UR+xkcPRug7zoFtFoaZSCbmSg RLP8d4jJO5FLv9sy/+8fnWkZnvStRxjY2NDKrNT0wOh/cQZshZdzrVIoDxGeQLcXVHOT BGgw== 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:date:subject:cc:to:from; bh=FtNRWPCh2/zcuhA71qLZgn+HefeA6sxlA8LJljQZN4w=; b=etb/hHm1mgsTQFw1+gQ2CfvukvRPn4mkAvOVj2Iafh/94hKpVERAT/MIx1T9MHCsDs oxqRDvsHLZ8XGfaAw1JqO8u6ruCz5NuUIOS8yDgLWTnuXR7mOcs8NU7OXZlX6p4Q910o ba4C7UKtD2vxqjEaK/H7W/rfWhEiY0u1q+Bn3MMXTh3T4ZE6dzn/Vu7mBuduW3lX+0MA xZR1g64axJf9+LQ2UvkpVmVE4vpv+8IWKQBMtMQQKPAkpq2MuDHkuqVG1tMYEScjZsbs 6AScnE8FmjrS72F7fKvjDsQY+Tv5fzaar48h3H3jw0iXZ4GljyylxxRd3N69VM7YL+2j a/gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rs7si1592549ejb.533.2020.04.28.04.22.21; Tue, 28 Apr 2020 04:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbgD1LSu (ORCPT + 99 others); Tue, 28 Apr 2020 07:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726481AbgD1LSs (ORCPT ); Tue, 28 Apr 2020 07:18:48 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7374DC03C1A9 for ; Tue, 28 Apr 2020 04:18:48 -0700 (PDT) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTOGE-0000UI-HE; Tue, 28 Apr 2020 13:18:46 +0200 Received: from afa by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1jTOGE-0007k1-4g; Tue, 28 Apr 2020 13:18:46 +0200 From: Ahmad Fatoum To: Srinivas Kandagatla Cc: kernel@pengutronix.de, ceggers@arri.de, Ahmad Fatoum , linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] nvmem: core: skip nodes with compatibles other than "nvmem-cell" Date: Tue, 28 Apr 2020 13:18:27 +0200 Message-Id: <20200428111829.2215-3-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428111829.2215-1-a.fatoum@pengutronix.de> References: <20200428111829.2215-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: afa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The nvmem cell binding used to apply to all objects which match "^.*@[0-9a-f]+$", without taking a compatible into account, which precluded extension of EEPROMs by child nodes other than nvmem. A previous commit changed the binding, so that nvmem cells that feature a compatible property must have "nvmem-cell" as the value, otherwise they are skipped. Adjust the driver to observe the new binding change. This change does not change behavior for any device tree that was already compliant with the nvmem binding. Signed-off-by: Ahmad Fatoum --- drivers/nvmem/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 05c6ae4b0b97..eb697f5ad07d 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -547,6 +547,10 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) parent = dev->of_node; for_each_child_of_node(parent, child) { + if (of_find_property(child, "compatible", NULL) && + !of_device_is_compatible(child, "nvmem-cell")) + continue; + addr = of_get_property(child, "reg", &len); if (!addr || (len < 2 * sizeof(u32))) { dev_err(dev, "nvmem: invalid reg on %pOF\n", child); -- 2.26.2