History log of /linux-master/drivers/base/physical_location.c
Revision Date Author Comments
# 0d150f96 22-Nov-2022 Hanjun Guo <guohanjun@huawei.com>

driver core: location: Free struct acpi_pld_info *pld before return false

struct acpi_pld_info *pld should be freed before the return of allocation
failure, to prevent memory leak, add the ACPI_FREE() to fix it.

Fixes: bc443c31def5 ("driver core: location: Check for allocations failure")
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://lore.kernel.org/r/1669102648-11517-1-git-send-email-guohanjun@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1f7ff11c 09-May-2022 Won Chung <wonchung@google.com>

driver core: location: Add "back" as a possible output for panel

Add "back" as a possible panel output when _PLD output from ACPI
indicates back panel.

Fixes: 6423d2951087 ("driver core: Add sysfs support for physical location of a device")
Signed-off-by: Won Chung <wonchung@google.com>
Link: https://lore.kernel.org/r/20220509214930.3573518-1-wonchung@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 28330dcc 09-May-2022 Won Chung <wonchung@google.com>

driver core: location: Free struct acpi_pld_info *pld

After struct acpi_pld_info *pld is used to fill in physical location
values, it should be freed to prevent memleak.

Suggested-by: Yu Watanabe <watanabe.yu@gmail.com>
Signed-off-by: Won Chung <wonchung@google.com>
Link: https://lore.kernel.org/r/20220509173135.3515126-1-wonchung@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bc443c31 05-May-2022 Dan Carpenter <dan.carpenter@oracle.com>

driver core: location: Check for allocations failure

Check whether the kzalloc() succeeds and return false if it fails.

Fixes: 6423d2951087 ("driver core: Add sysfs support for physical location of a device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YnOn28OFBHHd5bQb@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6423d295 14-Mar-2022 Won Chung <wonchung@google.com>

driver core: Add sysfs support for physical location of a device

When ACPI table includes _PLD fields for a device, create a new
directory (physical_location) in sysfs to share _PLD fields.

Currently without PLD information, when there are multiple of same
devices, it is hard to distinguish which device corresponds to which
physical device at which location. For example, when there are two Type
C connectors, it is hard to find out which connector corresponds to the
Type C port on the left panel versus the Type C port on the right panel.
With PLD information provided, we can determine which specific device at
which location is doing what.

_PLD output includes much more fields, but only generic fields are added
and exposed to sysfs, so that non-ACPI devices can also support it in
the future. The minimal generic fields needed for locating a device are
the following.
- panel
- vertical_position
- horizontal_position
- dock
- lid

Signed-off-by: Won Chung <wonchung@google.com>
Link: https://lore.kernel.org/r/20220314195458.271430-1-wonchung@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>