Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227773
b: refs/heads/master
c: 2bfe814
h: refs/heads/master
i:
  227771: 3ab0978
v: v3
  • Loading branch information
Guenter Roeck committed Jan 8, 2011
1 parent e3223e1 commit 6a0cc67
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41e71f97174ba08fcca7f31bf448de92abc8862e
refs/heads/master: 2bfe814826b7266a489895f731a777f8cbe37963
34 changes: 16 additions & 18 deletions trunk/drivers/hwmon/applesmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@ static int __wait_status(u8 val)

for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) {
udelay(us);
if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == val) {
if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == val)
return 0;
}
}

return -EIO;
Expand Down Expand Up @@ -431,7 +430,7 @@ static int applesmc_has_key(const char *key, bool *value)
/*
* applesmc_read_motion_sensor - Read motion sensor (X, Y or Z).
*/
static int applesmc_read_motion_sensor(int index, s16* value)
static int applesmc_read_motion_sensor(int index, s16 *value)
{
u8 buffer[2];
int ret;
Expand Down Expand Up @@ -779,14 +778,12 @@ static ssize_t applesmc_store_fan_speed(struct device *dev,
const char *sysfsbuf, size_t count)
{
int ret;
u32 speed;
unsigned long speed;
char newkey[5];
u8 buffer[2];

speed = simple_strtoul(sysfsbuf, NULL, 10);

if (speed > 0x4000) /* Bigger than a 14-bit value */
return -EINVAL;
if (strict_strtoul(sysfsbuf, 10, &speed) < 0 || speed >= 0x4000)
return -EINVAL; /* Bigger than a 14-bit value */

sprintf(newkey, fan_speed_fmt[to_option(attr)], to_index(attr));

Expand Down Expand Up @@ -822,10 +819,11 @@ static ssize_t applesmc_store_fan_manual(struct device *dev,
{
int ret;
u8 buffer[2];
u32 input;
unsigned long input;
u16 val;

input = simple_strtoul(sysfsbuf, NULL, 10);
if (strict_strtoul(sysfsbuf, 10, &input) < 0)
return -EINVAL;

ret = applesmc_read_key(FANS_MANUAL, buffer, 2);
val = (buffer[0] << 8 | buffer[1]);
Expand Down Expand Up @@ -1198,24 +1196,24 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir") },
},
{ applesmc_dmi_match, "Apple MacBook Pro", {
DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") },
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro") },
},
{ applesmc_dmi_match, "Apple MacBook", {
DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
DMI_MATCH(DMI_PRODUCT_NAME,"MacBook") },
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") },
},
{ applesmc_dmi_match, "Apple Macmini", {
DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
DMI_MATCH(DMI_PRODUCT_NAME,"Macmini") },
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "Macmini") },
},
{ applesmc_dmi_match, "Apple MacPro", {
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") },
},
{ applesmc_dmi_match, "Apple iMac", {
DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
DMI_MATCH(DMI_PRODUCT_NAME,"iMac") },
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "iMac") },
},
{ .ident = NULL }
};
Expand Down

0 comments on commit 6a0cc67

Please sign in to comment.