Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227743
b: refs/heads/master
c: e54c5ad
h: refs/heads/master
i:
  227741: 4803bbe
  227739: 6515225
  227735: 8eeac2a
  227727: 1d4b7c4
  227711: 589d8b2
v: v3
  • Loading branch information
Joe Perches authored and Guenter Roeck committed Jan 8, 2011
1 parent 1e366d3 commit de0353f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 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: 9c6e13b411cf0f656b7d7a78ec35bf0069f631bb
refs/heads/master: e54c5ad61f4e2c4fdfbdb8dff31fc604073d3550
29 changes: 13 additions & 16 deletions trunk/drivers/hwmon/f71805f.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -1309,7 +1311,7 @@ static int __devinit f71805f_probe(struct platform_device *pdev)

if (!(data = kzalloc(sizeof(struct f71805f_data), GFP_KERNEL))) {
err = -ENOMEM;
printk(KERN_ERR DRVNAME ": Out of memory\n");
pr_err("Out of memory\n");
goto exit;
}

Expand Down Expand Up @@ -1451,7 +1453,7 @@ static int __init f71805f_device_add(unsigned short address,
pdev = platform_device_alloc(DRVNAME, address);
if (!pdev) {
err = -ENOMEM;
printk(KERN_ERR DRVNAME ": Device allocation failed\n");
pr_err("Device allocation failed\n");
goto exit;
}

Expand All @@ -1462,22 +1464,20 @@ static int __init f71805f_device_add(unsigned short address,

err = platform_device_add_resources(pdev, &res, 1);
if (err) {
printk(KERN_ERR DRVNAME ": Device resource addition failed "
"(%d)\n", err);
pr_err("Device resource addition failed (%d)\n", err);
goto exit_device_put;
}

err = platform_device_add_data(pdev, sio_data,
sizeof(struct f71805f_sio_data));
if (err) {
printk(KERN_ERR DRVNAME ": Platform data allocation failed\n");
pr_err("Platform data allocation failed\n");
goto exit_device_put;
}

err = platform_device_add(pdev);
if (err) {
printk(KERN_ERR DRVNAME ": Device addition failed (%d)\n",
err);
pr_err("Device addition failed (%d)\n", err);
goto exit_device_put;
}

Expand Down Expand Up @@ -1516,30 +1516,27 @@ static int __init f71805f_find(int sioaddr, unsigned short *address,
sio_data->fnsel1 = superio_inb(sioaddr, SIO_REG_FNSEL1);
break;
default:
printk(KERN_INFO DRVNAME ": Unsupported Fintek device, "
"skipping\n");
pr_info("Unsupported Fintek device, skipping\n");
goto exit;
}

superio_select(sioaddr, F71805F_LD_HWM);
if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) {
printk(KERN_WARNING DRVNAME ": Device not activated, "
"skipping\n");
pr_warn("Device not activated, skipping\n");
goto exit;
}

*address = superio_inw(sioaddr, SIO_REG_ADDR);
if (*address == 0) {
printk(KERN_WARNING DRVNAME ": Base address not set, "
"skipping\n");
pr_warn("Base address not set, skipping\n");
goto exit;
}
*address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */

err = 0;
printk(KERN_INFO DRVNAME ": Found %s chip at %#x, revision %u\n",
names[sio_data->kind], *address,
superio_inb(sioaddr, SIO_REG_DEVREV));
pr_info("Found %s chip at %#x, revision %u\n",
names[sio_data->kind], *address,
superio_inb(sioaddr, SIO_REG_DEVREV));

exit:
superio_exit(sioaddr);
Expand Down

0 comments on commit de0353f

Please sign in to comment.