Commit c68ae33e authored by Lukas Wunner's avatar Lukas Wunner Committed by Rafael J. Wysocki

ACPI / utils: Rename acpi_dev_present()

acpi_dev_present() was originally named after pci_dev_present()
to signify the similarity of the two functions.

However Rafael J. Wysocki pointed out that the exported function
acpi_dev_present() is easily confused with the non-exported
acpi_device_is_present(). Additionally in ACPI parlance the term
"present" usually refers to the "device is present" bit returned
by the _STA control method, yet acpi_dev_present() merely checks
presence in the namespace. It does not invoke _STA at all, let
alone check the "device is present" bit.

As suggested by Rafael, rename the function to acpi_dev_found()
and adjust all existing call sites.
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9735a227
...@@ -707,7 +707,7 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs) ...@@ -707,7 +707,7 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs)
EXPORT_SYMBOL(acpi_check_dsm); EXPORT_SYMBOL(acpi_check_dsm);
/** /**
* acpi_dev_present - Detect presence of a given ACPI device in the system. * acpi_dev_found - Detect presence of a given ACPI device in the namespace.
* @hid: Hardware ID of the device. * @hid: Hardware ID of the device.
* *
* Return %true if the device was present at the moment of invocation. * Return %true if the device was present at the moment of invocation.
...@@ -719,7 +719,7 @@ EXPORT_SYMBOL(acpi_check_dsm); ...@@ -719,7 +719,7 @@ EXPORT_SYMBOL(acpi_check_dsm);
* instead). Calling from module_init() is fine (which is synonymous * instead). Calling from module_init() is fine (which is synonymous
* with device_initcall()). * with device_initcall()).
*/ */
bool acpi_dev_present(const char *hid) bool acpi_dev_found(const char *hid)
{ {
struct acpi_device_bus_id *acpi_device_bus_id; struct acpi_device_bus_id *acpi_device_bus_id;
bool found = false; bool found = false;
...@@ -734,7 +734,7 @@ bool acpi_dev_present(const char *hid) ...@@ -734,7 +734,7 @@ bool acpi_dev_present(const char *hid)
return found; return found;
} }
EXPORT_SYMBOL(acpi_dev_present); EXPORT_SYMBOL(acpi_dev_found);
/* /*
* acpi_backlight= handling, this is done here rather then in video_detect.c * acpi_backlight= handling, this is done here rather then in video_detect.c
......
...@@ -87,7 +87,7 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func, ...@@ -87,7 +87,7 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func,
.package.elements = (eles) \ .package.elements = (eles) \
} }
bool acpi_dev_present(const char *hid); bool acpi_dev_found(const char *hid);
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
*/ */
static inline bool apple_gmux_present(void) static inline bool apple_gmux_present(void)
{ {
return acpi_dev_present(GMUX_ACPI_HID); return acpi_dev_found(GMUX_ACPI_HID);
} }
#else /* !CONFIG_APPLE_GMUX */ #else /* !CONFIG_APPLE_GMUX */
......
...@@ -13,7 +13,7 @@ static void (*old_vmaster_hook)(void *, int); ...@@ -13,7 +13,7 @@ static void (*old_vmaster_hook)(void *, int);
static bool is_thinkpad(struct hda_codec *codec) static bool is_thinkpad(struct hda_codec *codec)
{ {
return (codec->core.subsystem_id >> 16 == 0x17aa) && return (codec->core.subsystem_id >> 16 == 0x17aa) &&
(acpi_dev_present("LEN0068") || acpi_dev_present("IBM0068")); (acpi_dev_found("LEN0068") || acpi_dev_found("IBM0068"));
} }
static void update_tpacpi_mute_led(void *private_data, int enabled) static void update_tpacpi_mute_led(void *private_data, int enabled)
......
...@@ -296,7 +296,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -296,7 +296,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
if (!drv) if (!drv)
return -ENOMEM; return -ENOMEM;
drv->ts3a227e_present = acpi_dev_present("104C227E"); drv->ts3a227e_present = acpi_dev_found("104C227E");
if (!drv->ts3a227e_present) { if (!drv->ts3a227e_present) {
/* no need probe TI jack detection chip */ /* no need probe TI jack detection chip */
snd_soc_card_cht.aux_dev = NULL; snd_soc_card_cht.aux_dev = NULL;
......
...@@ -357,7 +357,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -357,7 +357,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(snd_soc_cards); i++) { for (i = 0; i < ARRAY_SIZE(snd_soc_cards); i++) {
if (acpi_dev_present(snd_soc_cards[i].codec_id)) { if (acpi_dev_found(snd_soc_cards[i].codec_id)) {
dev_dbg(&pdev->dev, dev_dbg(&pdev->dev,
"found codec %s\n", snd_soc_cards[i].codec_id); "found codec %s\n", snd_soc_cards[i].codec_id);
card = snd_soc_cards[i].soc_card; card = snd_soc_cards[i].soc_card;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment