diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-08-13 15:39:10 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-08-13 15:39:10 -0400 |
commit | 0980bd9cd32de2fef7eaa2858345c49d14498625 (patch) | |
tree | 41f5f823d0569a81b22037e79c22d823933a63f1 /drivers/hwmon/max1111.c | |
parent | 78821b2c0299ab807d483802f09897728b93bce0 (diff) | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
Merge commit 'v3.6-rc1' into linux-next
* commit 'v3.6-rc1': (9532 commits)
Linux 3.6-rc1
mm: remove node_start_pfn checking in new WARN_ON for now
ARM: mmp: add missing irqs.h
arm: mvebu: fix typo in .dtsi comment for Armada XP SoCs
ARM: PRIMA2: delete redundant codes to restore LATCHED when timer resumes
libceph: fix crypto key null deref, memory leak
ceph: simplify+fix atomic_open
sh: explicitly include sh_dma.h in setup-sh7722.c
um: Add arch/x86/um to MAINTAINERS
um: pass siginfo to guest process
um: fix ubd_file_size for read-only files
md/dm-raid: DM_RAID should select MD_RAID10
md/raid1: submit IO from originating thread instead of md thread.
raid5: raid5d handle stripe in batch way
raid5: make_request use batch stripe release
um: pull interrupt_end() into userspace()
um: split syscall_trace(), pass pt_regs to it
um: switch UPT_SET_RETURN_VALUE and regs_return_value to pt_regs
MIPS: Loongson 2: Sort out clock managment.
locks: remove unused lm_release_private
...
Diffstat (limited to 'drivers/hwmon/max1111.c')
-rw-r--r-- | drivers/hwmon/max1111.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/hwmon/max1111.c b/drivers/hwmon/max1111.c index 362a40eb6129..f3978a46e844 100644 --- a/drivers/hwmon/max1111.c +++ b/drivers/hwmon/max1111.c @@ -168,7 +168,7 @@ static int __devinit max1111_probe(struct spi_device *spi) if (err < 0) return err; - data = kzalloc(sizeof(struct max1111_data), GFP_KERNEL); + data = devm_kzalloc(&spi->dev, sizeof(struct max1111_data), GFP_KERNEL); if (data == NULL) { dev_err(&spi->dev, "failed to allocate memory\n"); return -ENOMEM; @@ -176,7 +176,7 @@ static int __devinit max1111_probe(struct spi_device *spi) err = setup_transfer(data); if (err) - goto err_free_data; + return err; mutex_init(&data->drvdata_lock); @@ -186,7 +186,7 @@ static int __devinit max1111_probe(struct spi_device *spi) err = sysfs_create_group(&spi->dev.kobj, &max1111_attr_group); if (err) { dev_err(&spi->dev, "failed to create attribute group\n"); - goto err_free_data; + return err; } data->hwmon_dev = hwmon_device_register(&spi->dev); @@ -203,8 +203,6 @@ static int __devinit max1111_probe(struct spi_device *spi) err_remove: sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group); -err_free_data: - kfree(data); return err; } @@ -215,7 +213,6 @@ static int __devexit max1111_remove(struct spi_device *spi) hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group); mutex_destroy(&data->drvdata_lock); - kfree(data); return 0; } |