linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: mario.limonciello@amd.com, bhelgaas@google.com
Cc: Stephen Rothwell <sfr@canb.auug.org.au>, linux-pci@vger.kernel.org
Subject: [PATCH] PCI: Fix warning without CONFIG_VIDEO
Date: Fri, 18 Jul 2025 08:41:33 -0500	[thread overview]
Message-ID: <20250718134134.1710578-1-superm1@kernel.org> (raw)

From: Mario Limonciello <mario.limonciello@amd.com>

When compiled without CONFIG_VIDEO pci_create_boot_display_file() will
never create a sysfs file for boot_display. Guard the sysfs file
declaration against CONFIG_VIDEO.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/linux-next/20250718224118.5b3f22b0@canb.auug.org.au/
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/pci/pci-sysfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 6b1a0ae254d3a..f6540a72204d3 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -680,12 +680,14 @@ const struct attribute_group *pcibus_groups[] = {
 	NULL,
 };
 
+#ifdef CONFIG_VIDEO
 static ssize_t boot_display_show(struct device *dev, struct device_attribute *attr,
 				 char *buf)
 {
 	return sysfs_emit(buf, "1\n");
 }
 static DEVICE_ATTR_RO(boot_display);
+#endif /* CONFIG_VIDEO */
 
 static ssize_t boot_vga_show(struct device *dev, struct device_attribute *attr,
 			     char *buf)
-- 
2.43.0


             reply	other threads:[~2025-07-18 13:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18 13:41 Mario Limonciello [this message]
2025-07-18 17:00 ` [PATCH] PCI: Fix warning without CONFIG_VIDEO Manivannan Sadhasivam
2025-07-18 17:06   ` Mario Limonciello
2025-07-18 17:23     ` Manivannan Sadhasivam
2025-07-18 17:26       ` Mario Limonciello
2025-07-19  2:47         ` Manivannan Sadhasivam
2025-07-19 13:46           ` Mario Limonciello
2025-07-21  8:00             ` Manivannan Sadhasivam
2025-07-21 15:53               ` Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250718134134.1710578-1-superm1@kernel.org \
    --to=superm1@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).