Received: by 10.213.65.68 with SMTP id h4csp919975imn; Tue, 27 Mar 2018 11:12:28 -0700 (PDT) X-Google-Smtp-Source: AIpwx483A2TifrnHXztZppMWshWa2fQ3iGLzPLLDQdeWtMdMOpAZXSf37iQDF/Ki9d56YzsCAqCu X-Received: by 10.99.112.25 with SMTP id l25mr237514pgc.412.1522174348751; Tue, 27 Mar 2018 11:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522174348; cv=none; d=google.com; s=arc-20160816; b=vCrF9rtd5unhG7dVK/a9TgpG0Fa4mG/5GjkKc+TieiXftIW/fYQq48r/zrZ7Ez5zJc F2/5axHuK7RdVdZ/j/ZYR4heNsjRmf+3fK7DmTsjc3n4oILHS6nRcCIhtvAeHkguFzp/ tjdu04eJ9ls15lC+/UNmX4le8U0sKphmuqRo4HZMLNns25WzPQ5N1dkNegUWkbj10x34 f5w2ztdI3AmhEDmDPS6Ng7nJLRkDYp+rMVeHR/5F+UvHm8OrCvF7Vi+zhCV+xer5Z8sz VhiJeGjheU1fX1n5+UnSQIrnfA8tn+9v1qsyS6EhWH28DFre5qD5leEUSJWZRyZA4N+4 b6PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=DIgeIUAvv+VKAnpj9iAC/DsI4Fxwl373R7adcJDZGpg=; b=S5PC4W7olV7wkNEcJic9bviTnoVGkMg/nV8P6mvEbaAjMi5Wqzk6WrZWMAOIQcumUZ pDiiO6XwKohYVbUZTvhu6B8iFOdYGXHgaxCziEQW5Xvb5pJpo2+T3jWECJAwGyCH8l1p b3Mbkze9wrozSRuF0F9CzPPlOWdlcoJE8TWk6BYE7oDaZpfulS62nza6gmgBPOU8VuWT 3ZH1u0DrdJxeWljyNh3n733ft/hftc6QoDlMH5IyHF19SIlDRf36gdHnP/l+NaZBlUFt qkM8XB7HROT5dZXDZVwsPBF7yK2HoAzRPT2HXh6P3VSD6SBKEOPDxlVd1J/jLZuh7Jar bGLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z196si1131433pgz.349.2018.03.27.11.12.14; Tue, 27 Mar 2018 11:12:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752190AbeC0Q2p (ORCPT + 99 others); Tue, 27 Mar 2018 12:28:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40928 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbeC0Q2l (ORCPT ); Tue, 27 Mar 2018 12:28:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D89A21034; Tue, 27 Mar 2018 16:28:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Nosthoff , Jonathan Cameron Subject: [PATCH 4.4 02/43] iio: st_pressure: st_accel: pass correct platform data to init Date: Tue, 27 Mar 2018 18:27:06 +0200 Message-Id: <20180327162716.539364144@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162716.407986916@linuxfoundation.org> References: <20180327162716.407986916@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Nosthoff commit 8b438686a001db64c21782d04ef68111e53c45d9 upstream. Commit 7383d44b added a pointer pdata which get set to the default platform_data when non was defined in the device. But it did not pass this pointer to the st_sensors_init_sensor call but still used the maybe uninitialized platform_data from dev. This breaks initialization when no platform_data is given and the optional st,drdy-int-pin devicetree option is not set. This commit fixes this. Cc: stable@vger.kernel.org Fixes: 7383d44b ("iio: st_pressure: st_accel: Initialise sensor platform data properly") Signed-off-by: Michael Nosthoff Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/accel/st_accel_core.c | 2 +- drivers/iio/pressure/st_pressure_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -657,7 +657,7 @@ int st_accel_common_probe(struct iio_dev if (!pdata) pdata = (struct st_sensors_platform_data *)&default_accel_pdata; - err = st_sensors_init_sensor(indio_dev, adata->dev->platform_data); + err = st_sensors_init_sensor(indio_dev, pdata); if (err < 0) return err; --- a/drivers/iio/pressure/st_pressure_core.c +++ b/drivers/iio/pressure/st_pressure_core.c @@ -469,7 +469,7 @@ int st_press_common_probe(struct iio_dev if (!pdata && press_data->sensor_settings->drdy_irq.addr) pdata = (struct st_sensors_platform_data *)&default_press_pdata; - err = st_sensors_init_sensor(indio_dev, press_data->dev->platform_data); + err = st_sensors_init_sensor(indio_dev, pdata); if (err < 0) return err;