From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbbBMICl (ORCPT ); Fri, 13 Feb 2015 03:02:41 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:61515 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752344AbbBMICj (ORCPT ); Fri, 13 Feb 2015 03:02:39 -0500 From: Andrey Smirnov To: linux-iio@vger.kernel.org Cc: Andrey Smirnov , linux-kernel@vger.kernel.org, Jonathan Cameron Subject: [PATCH] IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc Date: Thu, 12 Feb 2015 23:58:41 -0800 Message-Id: <1423814321-15606-1-git-send-email-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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