Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dff4e7f authored by Len Brown's avatar Len Brown
Browse files

Merge branch 'pnp-debug' into test

parents 5f50ef45 ac88a8f3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1687,6 +1687,10 @@ and is between 256 and 4096 characters. It is defined in the file
			Override pmtimer IOPort with a hex value.
			e.g. pmtmr=0x508

	pnp.debug	[PNP]
			Enable PNP debug messages.  This depends on the
			CONFIG_PNP_DEBUG_MESSAGES option.

	pnpacpi=	[ACPI]
			{ off }

+14 −6
Original line number Diff line number Diff line
@@ -20,13 +20,21 @@ menuconfig PNP

	  If unsure, say Y.

if PNP

config PNP_DEBUG
	bool "PnP Debug Messages"
config PNP_DEBUG_MESSAGES
	default y
	bool "PNP debugging messages"
	depends on PNP
	help
	  Say Y if you want the Plug and Play Layer to print debug messages.
	  This is useful if you are developing a PnP driver or troubleshooting.
	  Say Y here if you want the PNP layer to be able to produce debugging
	  messages if needed.  The messages can be enabled at boot-time with
	  the pnp.debug kernel parameter.

	  This option allows you to save a bit of space if you do not want
	  the messages to even be built into the kernel.

	  If you have any doubts about this, say Y here.

if PNP

comment "Protocols"

+0 −4
Original line number Diff line number Diff line
@@ -7,7 +7,3 @@ obj-y := core.o card.o driver.o resource.o manager.o support.o interface.o quir
obj-$(CONFIG_PNPACPI)		+= pnpacpi/
obj-$(CONFIG_PNPBIOS)		+= pnpbios/
obj-$(CONFIG_ISAPNP)		+= isapnp/

ifeq ($(CONFIG_PNP_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
+10 −0
Original line number Diff line number Diff line
@@ -166,3 +166,13 @@ struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev,
struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev,
					  resource_size_t start,
					  resource_size_t end, int flags);

extern int pnp_debug;

#if defined(CONFIG_PNP_DEBUG_MESSAGES)
#define pnp_dbg(dev, format, arg...)					\
	({ if (pnp_debug) dev_printk(KERN_DEBUG, dev, format, ## arg); 0; })
#else
#define pnp_dbg(dev, format, arg...)					\
	({ if (0) dev_printk(KERN_DEBUG, dev, format, ## arg); 0; })
#endif
+19 −10
Original line number Diff line number Diff line
@@ -185,6 +185,9 @@ int __pnp_add_device(struct pnp_dev *dev)
int pnp_add_device(struct pnp_dev *dev)
{
	int ret;
	char buf[128];
	int len = 0;
	struct pnp_id *id;

	if (dev->card)
		return -EINVAL;
@@ -193,17 +196,12 @@ int pnp_add_device(struct pnp_dev *dev)
	if (ret)
		return ret;

#ifdef CONFIG_PNP_DEBUG
	{
		struct pnp_id *id;

		dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs",
			dev->protocol->name);
	buf[0] = '\0';
	for (id = dev->id; id; id = id->next)
			printk(" %s", id->id);
		printk(" (%s)\n", dev->active ? "active" : "disabled");
	}
#endif
		len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id);

	pnp_dbg(&dev->dev, "%s device, IDs%s (%s)\n",
		dev->protocol->name, buf, dev->active ? "active" : "disabled");
	return 0;
}

@@ -223,3 +221,14 @@ static int __init pnp_init(void)
}

subsys_initcall(pnp_init);

int pnp_debug;

#if defined(CONFIG_PNP_DEBUG_MESSAGES)
static int __init pnp_debug_setup(char *__unused)
{
	pnp_debug = 1;
	return 1;
}
__setup("pnp.debug", pnp_debug_setup);
#endif
Loading