[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1423814321-15606-1-git-send-email-andrew.smirnov@gmail.com>
Date: Thu, 12 Feb 2015 23:58:41 -0800
From: Andrey Smirnov <andrew.smirnov@...il.com>
To: linux-iio@...r.kernel.org
Cc: Andrey Smirnov <andrew.smirnov@...il.com>,
linux-kernel@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>
Subject: [PATCH] IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc
Since only a pointer to struct i2c_client is stored in a private area
of IIO device created by the driver there's no need to allocate
sizeof(struct i2c_client) worth of storage.
Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
---
drivers/iio/humidity/si7020.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c
index 69e49f5..fa3b809 100644
--- a/drivers/iio/humidity/si7020.c
+++ b/drivers/iio/humidity/si7020.c
@@ -126,7 +126,7 @@ static int si7020_probe(struct i2c_client *client,
/* Wait the maximum power-up time after software reset. */
msleep(15);
- indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*client));
+ indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
if (!indio_dev)
return -ENOMEM;
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists