Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp959196iob; Fri, 13 May 2022 17:45:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmb6v/hBTLNN3NLyljz3UrWNO6wiFpQ29f74vMTR3iOqP750SCGiKbRn4cYU+Zm69uk6vf X-Received: by 2002:a05:600c:382:b0:394:6172:59dc with SMTP id w2-20020a05600c038200b00394617259dcmr17106263wmd.120.1652489113847; Fri, 13 May 2022 17:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652489113; cv=none; d=google.com; s=arc-20160816; b=S/1wh6m5msX0LLR000PkSRzFWrL82E2ZgyDi3cWGs8TlcFyYWf9uin52jPJHRkJJzA unlCbebt9JlswfWgu7Ck0tLLlBpNtSgqTyLYD4ZI97R9SpYM2SiaeGHcyTfF8L6Actnj NWOv7UVvKEJygnr9bdMBOCkp3LtEW6vbnrRu8oNgjo+qAppx8GswIqucz2J4z4zZ35mA 1IqUJNtgIUQkXCVamUHFUtyP+Db4MQOEZgrV57d0hqO8pJvdtoPEajQkEcIUR1MO0iPO B/PJ+hWyrjJj4aEOm+rP/9TtPO8tnJ9E22A38SOI651pX5gYFP4epbVpdpYcpf2O7q4I RdlA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MRhm9+AKqiCcFzEMtgbAPpFPGlNCeXLEsZ2HWJ7ms0c=; b=rukMD0iEIxDXRs0+dHrAnpPtcalZC/g6jw72M8A9AC06fo8N6lTmrv5GfsaipDoZYw QHXaHqcQJFJkFWHzSkU+WfEyY/6LdQRQexObfX3F/73Izxm7ICbgO6t7ShAmQOzqA1dL 2Keggdp8ZkQkzCVo/iwTzD1OKUVYMkxBRfQbZp4ncp987xYfQYlIUpGP7xBnuNWv8rsI s7B/bwWKIHh9NGJ+48v6Kj/x8qwrXs/wEdVSvEIagSZ27Fhg8f5W3ccp+7VdS+XqdqiO YVobT88Nh9s9tpCVEBKZ+yDNxO0km7gTnD6bUOS20Td5VUpSiLxiKVne4HEFu90dz08y XyCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=ZhTR67jM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b15-20020a05600c4e0f00b00394430ff30fsi7361308wmq.202.2022.05.13.17.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:45:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=ZhTR67jM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06C603206B2; Fri, 13 May 2022 16:24:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381571AbiEMNiI (ORCPT + 99 others); Fri, 13 May 2022 09:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381350AbiEMNfc (ORCPT ); Fri, 13 May 2022 09:35:32 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4753A614D for ; Fri, 13 May 2022 06:35:30 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 62C1822249; Fri, 13 May 2022 15:35:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1652448928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MRhm9+AKqiCcFzEMtgbAPpFPGlNCeXLEsZ2HWJ7ms0c=; b=ZhTR67jMRyktCADJBzMCgBxZXj5Y48+NC4yRJ2e+cLkHVKej8MxqnREkz56Kx/05gT3slt shj3wLY+wp3CwbGtPvULuvDRGPXlnntCSem8E5uTc/o/w2jVA4DScBmhSui79amE1ZeOHH nqyem7xqbK3UCQ9qct/bCAF0zhKN3cQ= From: Michael Walle To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH 2/6] mtd: spi-nor: sysfs: hide manufacturer if it is not set Date: Fri, 13 May 2022 15:35:16 +0200 Message-Id: <20220513133520.3945820-3-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220513133520.3945820-1-michael@walle.cc> References: <20220513133520.3945820-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 The manufacturer may be optional when pure SFDP flashes are supported. Hide the sysfs property if no manufacturer is set. Signed-off-by: Michael Walle --- Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor | 3 +++ drivers/mtd/spi-nor/sysfs.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor b/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor index e9ef69aef20b..c800621eff95 100644 --- a/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor +++ b/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor @@ -15,6 +15,9 @@ KernelVersion: 5.14 Contact: linux-mtd@lists.infradead.org Description: (RO) Manufacturer of the SPI NOR flash. + The attribute is not present if the flash device isn't + known to the kernel and is only probed by its SFDP + tables. What: /sys/bus/spi/devices/.../spi-nor/partname Date: April 2021 diff --git a/drivers/mtd/spi-nor/sysfs.c b/drivers/mtd/spi-nor/sysfs.c index 4c3b351aef24..20563c1926f4 100644 --- a/drivers/mtd/spi-nor/sysfs.c +++ b/drivers/mtd/spi-nor/sysfs.c @@ -74,6 +74,8 @@ static umode_t spi_nor_sysfs_is_visible(struct kobject *kobj, struct spi_mem *spimem = spi_get_drvdata(spi); struct spi_nor *nor = spi_mem_get_drvdata(spimem); + if (attr == &dev_attr_manufacturer.attr && !nor->manufacturer) + return 0; if (attr == &dev_attr_jedec_id.attr && !nor->info->id_len) return 0; -- 2.30.2