diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-09-04 17:01:37 +0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-09-04 17:01:37 +0400 |
commit | 863e99a8c1ea2b0391491904297f57a0f6a1fdd6 (patch) | |
tree | 0e7789f83c0ba3a1bc3c19d3ccf5ea6f84f19db6 /drivers/hwmon/emc6w201.c | |
parent | dd9bf78040fa0da4cecc228e1682b9682b8cb180 (diff) | |
parent | a849088aa1552b1a28eea3daff599ee22a734ae3 (diff) | |
download | linux-863e99a8c1ea2b0391491904297f57a0f6a1fdd6.tar.xz |
Merge commit 'a849088aa1' from rmk/fixes into cleanup/io-pci
As Stephen Rothwell reports, a849088aa155 ("ARM: Fix ioremap() of
address zero") from the arm-current tree and commit c2794437091a ("ARM:
Add fixed PCI i/o mapping") from the arm-soc tree conflict in
a nontrivial way in arch/arm/mm/mmu.c.
Rob Herring explains:
The PCI i/o reserved area has a dummy physical address of 0 and
needs to be skipped by ioremap searches. So we don't set
VM_ARM_STATIC_MAPPING to prevent matches by ioremap. The vm_struct
settings don't really matter when we do the real mapping of the
i/o space.
Since commit a849088aa155 is at the start of the fixes branch
in the arm tree, we can merge it into the branch that contains
the other ioremap changes.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/hwmon/emc6w201.c')
-rw-r--r-- | drivers/hwmon/emc6w201.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/hwmon/emc6w201.c b/drivers/hwmon/emc6w201.c index 840f5112e602..ada12a98a97c 100644 --- a/drivers/hwmon/emc6w201.c +++ b/drivers/hwmon/emc6w201.c @@ -492,11 +492,10 @@ static int emc6w201_probe(struct i2c_client *client, struct emc6w201_data *data; int err; - data = kzalloc(sizeof(struct emc6w201_data), GFP_KERNEL); - if (!data) { - err = -ENOMEM; - goto exit; - } + data = devm_kzalloc(&client->dev, sizeof(struct emc6w201_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; i2c_set_clientdata(client, data); mutex_init(&data->update_lock); @@ -504,7 +503,7 @@ static int emc6w201_probe(struct i2c_client *client, /* Create sysfs attribute */ err = sysfs_create_group(&client->dev.kobj, &emc6w201_group); if (err) - goto exit_free; + return err; /* Expose as a hwmon device */ data->hwmon_dev = hwmon_device_register(&client->dev); @@ -517,9 +516,6 @@ static int emc6w201_probe(struct i2c_client *client, exit_remove: sysfs_remove_group(&client->dev.kobj, &emc6w201_group); - exit_free: - kfree(data); - exit: return err; } @@ -529,7 +525,6 @@ static int emc6w201_remove(struct i2c_client *client) hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&client->dev.kobj, &emc6w201_group); - kfree(data); return 0; } |