Re: [PATCH] Bluetooth: hci_intel: Cleanup the device probe code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/30/2015 05:52 PM, Marcel Holtmann wrote:
Hi Jarkko,

There is some unneeded code in "hci_intel" probing. First
acpi_match_device() call is needless as driver/platform/acpi core code has
already done the matching before calling the probe and the driver does not
use the returned pointer to matching _HID other than checking is it NULL.

Then tree wide grep for "hci_intel" doesn't reveal that there is any code
registering this platform device so it looks this device is always backed
with ACPI companion so also ACPI_HANDLE() test can be removed.

eventually there will be DT platform device. Does that make a difference or is it still valid to remove this probe handling.

Also with DT matching the acpi_match_device() is needless. Adding DT support here means just adding pointer to OF match table like below and core will call the probe if there is a match to "hci_intel" platform device, ACPI _HID or OF node.

static struct platform_driver intel_driver = {
	.driver = {
		.name = "hci_intel",
		.acpi_match_table = ACPI_PTR(intel_acpi_match),
		.of_match_table = of_match_ptr(intel_of_match),
	},
};

If there is need to differentiate between these in probe the driver could do for instance

if (has_acpi_companion(&pdev->dev)) {
	/* ACPI enumerated */
} else if (pdev->dev.of_node) {
	/* DT enumerated */
} else {
	/* platform device */
}

--
Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux