Skip to content

Commit

Permalink
Merge branches 'acpi-processor', 'acpi-battery', 'acpi-utils' and 'ac…
Browse files Browse the repository at this point in the history
…pi-fan'

* acpi-processor:
  ACPI / processor: use container_of instead of casting first structure member

* acpi-battery:
  ACPI / battery: Replace strnicmp with strncasecmp

* acpi-utils:
  ACPI / utils: Update acpi_check_dsm() comments

* acpi-fan:
  ACPI / fan: printk replacement
  • Loading branch information
Rafael J. Wysocki committed Oct 6, 2014
5 parents dbcbe68 + ef86c3f + ffd8a73 + 5d30f74 + 88989fd commit 1e765cd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
if (battery->power_unit && dmi_name_in_vendors("LENOVO")) {
const char *s;
s = dmi_get_system_info(DMI_PRODUCT_VERSION);
if (s && !strnicmp(s, "ThinkPad", 8)) {
if (s && !strncasecmp(s, "ThinkPad", 8)) {
dmi_walk(find_battery, battery);
if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
&battery->flags) &&
Expand Down
18 changes: 8 additions & 10 deletions drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <linux/thermal.h>
#include <linux/acpi.h>

#define PREFIX "ACPI: "

#define ACPI_FAN_CLASS "fan"
#define ACPI_FAN_FILE_STATE "state"

Expand Down Expand Up @@ -127,8 +125,9 @@ static const struct thermal_cooling_device_ops fan_cooling_ops = {
};

/* --------------------------------------------------------------------------
Driver Interface
-------------------------------------------------------------------------- */
* Driver Interface
* --------------------------------------------------------------------------
*/

static int acpi_fan_add(struct acpi_device *device)
{
Expand All @@ -143,7 +142,7 @@ static int acpi_fan_add(struct acpi_device *device)

result = acpi_bus_update_power(device->handle, NULL);
if (result) {
printk(KERN_ERR PREFIX "Setting initial power state\n");
dev_err(&device->dev, "Setting initial power state\n");
goto end;
}

Expand All @@ -168,10 +167,9 @@ static int acpi_fan_add(struct acpi_device *device)
&device->dev.kobj,
"device");
if (result)
dev_err(&device->dev, "Failed to create sysfs link "
"'device'\n");
dev_err(&device->dev, "Failed to create sysfs link 'device'\n");

printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
dev_info(&device->dev, "ACPI: %s [%s] (%s)\n",
acpi_device_name(device), acpi_device_bid(device),
!device->power.state ? "on" : "off");

Expand Down Expand Up @@ -217,7 +215,7 @@ static int acpi_fan_resume(struct device *dev)

result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL);
if (result)
printk(KERN_ERR PREFIX "Error updating fan power state\n");
dev_err(dev, "Error updating fan power state\n");

return result;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
u32 acpi_id, int *apic_id)
{
struct acpi_madt_local_apic *lapic =
(struct acpi_madt_local_apic *)entry;
container_of(entry, struct acpi_madt_local_apic, header);

if (!(lapic->lapic_flags & ACPI_MADT_ENABLED))
return -ENODEV;
Expand All @@ -32,7 +32,7 @@ static int map_x2apic_id(struct acpi_subtable_header *entry,
int device_declaration, u32 acpi_id, int *apic_id)
{
struct acpi_madt_local_x2apic *apic =
(struct acpi_madt_local_x2apic *)entry;
container_of(entry, struct acpi_madt_local_x2apic, header);

if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
return -ENODEV;
Expand All @@ -49,7 +49,7 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
int device_declaration, u32 acpi_id, int *apic_id)
{
struct acpi_madt_local_sapic *lsapic =
(struct acpi_madt_local_sapic *)entry;
container_of(entry, struct acpi_madt_local_sapic, header);

if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))
return -ENODEV;
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ EXPORT_SYMBOL(acpi_evaluate_dsm);
* @uuid: UUID of requested functions, should be 16 bytes at least
* @rev: revision number of requested functions
* @funcs: bitmap of requested functions
* @exclude: excluding special value, used to support i915 and nouveau
*
* Evaluate device's _DSM method to check whether it supports requested
* functions. Currently only support 64 functions at maximum, should be
Expand Down

0 comments on commit 1e765cd

Please sign in to comment.