Skip to content

Commit c68ae33

Browse files
l1krafaeljw
authored andcommitted
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: Lukas Wunner <lukas@wunner.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9735a22 commit c68ae33

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎drivers/acpi/utils.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs)
707707
EXPORT_SYMBOL(acpi_check_dsm);
708708

709709
/**
710-
* acpi_dev_present - Detect presence of a given ACPI device in the system.
710+
* acpi_dev_found - Detect presence of a given ACPI device in the namespace.
711711
* @hid: Hardware ID of the device.
712712
*
713713
* Return %true if the device was present at the moment of invocation.
@@ -719,7 +719,7 @@ EXPORT_SYMBOL(acpi_check_dsm);
719719
* instead). Calling from module_init() is fine (which is synonymous
720720
* with device_initcall()).
721721
*/
722-
bool acpi_dev_present(const char *hid)
722+
bool acpi_dev_found(const char *hid)
723723
{
724724
struct acpi_device_bus_id *acpi_device_bus_id;
725725
bool found = false;
@@ -734,7 +734,7 @@ bool acpi_dev_present(const char *hid)
734734

735735
return found;
736736
}
737-
EXPORT_SYMBOL(acpi_dev_present);
737+
EXPORT_SYMBOL(acpi_dev_found);
738738

739739
/*
740740
* acpi_backlight= handling, this is done here rather then in video_detect.c

‎include/acpi/acpi_bus.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func,
8787
.package.elements = (eles) \
8888
}
8989

90-
bool acpi_dev_present(const char *hid);
90+
bool acpi_dev_found(const char *hid);
9191

9292
#ifdef CONFIG_ACPI
9393

‎include/linux/apple-gmux.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
static inline bool apple_gmux_present(void)
3737
{
38-
return acpi_dev_present(GMUX_ACPI_HID);
38+
return acpi_dev_found(GMUX_ACPI_HID);
3939
}
4040

4141
#else /* !CONFIG_APPLE_GMUX */

‎sound/pci/hda/thinkpad_helper.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static void (*old_vmaster_hook)(void *, int);
1313
static bool is_thinkpad(struct hda_codec *codec)
1414
{
1515
return (codec->core.subsystem_id >> 16 == 0x17aa) &&
16-
(acpi_dev_present("LEN0068") || acpi_dev_present("IBM0068"));
16+
(acpi_dev_found("LEN0068") || acpi_dev_found("IBM0068"));
1717
}
1818

1919
static void update_tpacpi_mute_led(void *private_data, int enabled)

‎sound/soc/intel/boards/cht_bsw_max98090_ti.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
296296
if (!drv)
297297
return -ENOMEM;
298298

299-
drv->ts3a227e_present = acpi_dev_present("104C227E");
299+
drv->ts3a227e_present = acpi_dev_found("104C227E");
300300
if (!drv->ts3a227e_present) {
301301
/* no need probe TI jack detection chip */
302302
snd_soc_card_cht.aux_dev = NULL;

‎sound/soc/intel/boards/cht_bsw_rt5645.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
357357
return -ENOMEM;
358358

359359
for (i = 0; i < ARRAY_SIZE(snd_soc_cards); i++) {
360-
if (acpi_dev_present(snd_soc_cards[i].codec_id)) {
360+
if (acpi_dev_found(snd_soc_cards[i].codec_id)) {
361361
dev_dbg(&pdev->dev,
362362
"found codec %s\n", snd_soc_cards[i].codec_id);
363363
card = snd_soc_cards[i].soc_card;

0 commit comments

Comments
 (0)