* [PATCH] Bluetooth: hci_intel: Cleanup the device probe code
@ 2015-09-30 13:28 Jarkko Nikula
[not found] ` <1443619732-19401-1-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-10-01 6:57 ` Marcel Holtmann
0 siblings, 2 replies; 6+ messages in thread
From: Jarkko Nikula @ 2015-09-30 13:28 UTC (permalink / raw)
To: linux-bluetooth
Cc: linux-acpi, Marcel Holtmann, Gustavo Padovan, Johan Hedberg,
Loic Poulain, Jarkko Nikula
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.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
drivers/bluetooth/hci_intel.c | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c
index 49e25409de67..2952107e3bae 100644
--- a/drivers/bluetooth/hci_intel.c
+++ b/drivers/bluetooth/hci_intel.c
@@ -1165,22 +1165,6 @@ static const struct acpi_device_id intel_acpi_match[] = {
{ },
};
MODULE_DEVICE_TABLE(acpi, intel_acpi_match);
-
-static int intel_acpi_probe(struct intel_device *idev)
-{
- const struct acpi_device_id *id;
-
- id = acpi_match_device(intel_acpi_match, &idev->pdev->dev);
- if (!id)
- return -ENODEV;
-
- return 0;
-}
-#else
-static int intel_acpi_probe(struct intel_device *idev)
-{
- return -ENODEV;
-}
#endif
#ifdef CONFIG_PM
@@ -1248,14 +1232,6 @@ static int intel_probe(struct platform_device *pdev)
idev->pdev = pdev;
- if (ACPI_HANDLE(&pdev->dev)) {
- int err = intel_acpi_probe(idev);
- if (err)
- return err;
- } else {
- return -ENODEV;
- }
-
idev->reset = devm_gpiod_get_optional(&pdev->dev, "reset",
GPIOD_OUT_LOW);
if (IS_ERR(idev->reset)) {
--
2.5.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Bluetooth: hci_intel: Cleanup the device probe code
2015-09-30 13:28 [PATCH] Bluetooth: hci_intel: Cleanup the device probe code Jarkko Nikula
@ 2015-09-30 14:52 ` Marcel Holtmann
2015-10-01 6:57 ` Marcel Holtmann
1 sibling, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2015-09-30 14:52 UTC (permalink / raw)
To: Jarkko Nikula
Cc: linux-bluetooth, linux-acpi-u79uwXL29TY76Z2rM5mHXA,
Gustavo F. Padovan, Johan Hedberg, Loic Poulain
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.
Regards
Marcel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bluetooth: hci_intel: Cleanup the device probe code
@ 2015-09-30 14:52 ` Marcel Holtmann
0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2015-09-30 14:52 UTC (permalink / raw)
To: Jarkko Nikula
Cc: linux-bluetooth, linux-acpi, Gustavo F. Padovan, Johan Hedberg,
Loic Poulain
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.
Regards
Marcel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bluetooth: hci_intel: Cleanup the device probe code
2015-09-30 14:52 ` Marcel Holtmann
@ 2015-10-01 6:26 ` Jarkko Nikula
-1 siblings, 0 replies; 6+ messages in thread
From: Jarkko Nikula @ 2015-10-01 6:26 UTC (permalink / raw)
To: Marcel Holtmann
Cc: linux-bluetooth, linux-acpi-u79uwXL29TY76Z2rM5mHXA,
Gustavo F. Padovan, Johan Hedberg, Loic Poulain
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bluetooth: hci_intel: Cleanup the device probe code
@ 2015-10-01 6:26 ` Jarkko Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Nikula @ 2015-10-01 6:26 UTC (permalink / raw)
To: Marcel Holtmann
Cc: linux-bluetooth, linux-acpi, Gustavo F. Padovan, Johan Hedberg,
Loic Poulain
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bluetooth: hci_intel: Cleanup the device probe code
2015-09-30 13:28 [PATCH] Bluetooth: hci_intel: Cleanup the device probe code Jarkko Nikula
[not found] ` <1443619732-19401-1-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2015-10-01 6:57 ` Marcel Holtmann
1 sibling, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2015-10-01 6:57 UTC (permalink / raw)
To: Jarkko Nikula
Cc: linux-bluetooth, linux-acpi, Gustavo F. Padovan, Johan Hedberg,
Loic Poulain
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.
>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
> drivers/bluetooth/hci_intel.c | 24 ------------------------
> 1 file changed, 24 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-01 6:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-30 13:28 [PATCH] Bluetooth: hci_intel: Cleanup the device probe code Jarkko Nikula
[not found] ` <1443619732-19401-1-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-09-30 14:52 ` Marcel Holtmann
2015-09-30 14:52 ` Marcel Holtmann
[not found] ` <9BB7E6C8-A45E-4D88-8B01-D1660370B7FF-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
2015-10-01 6:26 ` Jarkko Nikula
2015-10-01 6:26 ` Jarkko Nikula
2015-10-01 6:57 ` Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.