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

Commit 409ffed2 authored by Joe Perches's avatar Joe Perches Committed by Rafael J. Wysocki
Browse files

ACPI / PCI: pci_slot: Use generic pr_debug utility



Remove the dbg macro and debug module parameter and use
the generic kernel facility.

Trivially reduces defconfig object size on x86-64

$ size drivers/acpi/pci_slot.o*
   text	   data	    bss	    dec	    hex	filename
    880	    752	      4	   1636	    664	drivers/acpi/pci_slot.o.new
    935	    752	      5	   1692	    69c	drivers/acpi/pci_slot.o.old

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 2cfd93dd
Loading
Loading
Loading
Loading
+7 −14
Original line number Original line Diff line number Diff line
@@ -35,7 +35,6 @@
#include <linux/dmi.h>
#include <linux/dmi.h>
#include <linux/pci-acpi.h>
#include <linux/pci-acpi.h>


static bool debug;
static int check_sta_before_sun;
static int check_sta_before_sun;


#define DRIVER_VERSION 	"0.1"
#define DRIVER_VERSION 	"0.1"
@@ -44,18 +43,10 @@ static int check_sta_before_sun;
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
module_param(debug, bool, 0644);


#define _COMPONENT		ACPI_PCI_COMPONENT
#define _COMPONENT		ACPI_PCI_COMPONENT
ACPI_MODULE_NAME("pci_slot");
ACPI_MODULE_NAME("pci_slot");


#define dbg(fmt, ...)						\
do {								\
	if (debug)						\
		pr_debug(fmt, ##__VA_ARGS__);			\
} while (0)

#define SLOT_NAME_SIZE 21		/* Inspired by #define in acpiphp.h */
#define SLOT_NAME_SIZE 21		/* Inspired by #define in acpiphp.h */


struct acpi_pci_slot {
struct acpi_pci_slot {
@@ -75,7 +66,7 @@ check_slot(acpi_handle handle, unsigned long long *sun)
	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };


	acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
	acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
	dbg("Checking slot on path: %s\n", (char *)buffer.pointer);
	pr_debug("Checking slot on path: %s\n", (char *)buffer.pointer);


	if (check_sta_before_sun) {
	if (check_sta_before_sun) {
		/* If SxFy doesn't have _STA, we just assume it's there */
		/* If SxFy doesn't have _STA, we just assume it's there */
@@ -86,14 +77,16 @@ check_slot(acpi_handle handle, unsigned long long *sun)


	status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
	status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
	if (ACPI_FAILURE(status)) {
	if (ACPI_FAILURE(status)) {
		dbg("_ADR returned %d on %s\n", status, (char *)buffer.pointer);
		pr_debug("_ADR returned %d on %s\n",
			 status, (char *)buffer.pointer);
		goto out;
		goto out;
	}
	}


	/* No _SUN == not a slot == bail */
	/* No _SUN == not a slot == bail */
	status = acpi_evaluate_integer(handle, "_SUN", NULL, sun);
	status = acpi_evaluate_integer(handle, "_SUN", NULL, sun);
	if (ACPI_FAILURE(status)) {
	if (ACPI_FAILURE(status)) {
		dbg("_SUN returned %d on %s\n", status, (char *)buffer.pointer);
		pr_debug("_SUN returned %d on %s\n",
			 status, (char *)buffer.pointer);
		goto out;
		goto out;
	}
	}


@@ -147,7 +140,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)


	get_device(&pci_bus->dev);
	get_device(&pci_bus->dev);


	dbg("%p, pci_bus: %x, device: %d, name: %s\n",
	pr_debug("%p, pci_bus: %x, device: %d, name: %s\n",
		 pci_slot, pci_bus->number, device, name);
		 pci_slot, pci_bus->number, device, name);


	return AE_OK;
	return AE_OK;