Received: by 10.213.65.68 with SMTP id h4csp908623imn; Tue, 27 Mar 2018 11:00:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx499lsL649T0VoG6nYvEeXEXoeCPCEN//WCp9+bLXEKfyZdjOR2TAhuVGEEoN2jDLezQN87N X-Received: by 10.101.73.141 with SMTP id r13mr208971pgs.426.1522173636666; Tue, 27 Mar 2018 11:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522173636; cv=none; d=google.com; s=arc-20160816; b=h5S02mOdhoYhXV45qsVGDawj93im80MCkpdEgbgB7DI4KXDDB1+Ht80bbi4jS7vQHy 2PUu3rCNuDkPD9MLVAgS+E88DR0PE6DJy8nsbkaKzmSGrbr0CyJFAxyh1mlnJe7LJYi+ Hv1TKXiuoxwscnCbhbmqvYbgJx6aAZKJ1CRgNiDnKfwLdKgB1Dxs0DgxfhM8iokb8nx2 SXQ+A13BC+AxHEwZ6qfMP4V8qhGdO3xg+lWGIUnt90SEGuvCfaPhaaWwSGJbDIOOfnR3 Ml8Etp9i5iI015wkXpCundCyPQPipNiCopqhC5nfDtZ4USvKQJz4hGC7dsHVBlg6Ve+r sjjg== 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=tb8qVtCYSbUELcyse/LeZZrgyR2K8ao4bLrq+/KZumQ=; b=AzWfAU86GTALFvYFkcV+dqWbO4itGAg8mPlAf/KFrVYHsZk4U56u8SwDbqfonjg+YT GuXyIuhnlzUcxbxhM+B5GsnLJyHmgTArBw1bInmleK/S1i1DBW+oVYMgiURUnORYcidD ZG3JRJDOhivztH4RlP4nRCw6/n+TN5KickI/FmduvWQ/6Nd+oTX0K/F6sCYO7e8Scw5N v0qmy7arEpiDmvrshvzsMxBogGGOlwnw2fHZT4dMpu+TNW1GdJEXAf4XIjctgj+XQGvf VSoZ++ZwSc1qVqSrailZ8etOU04KIdKUxj8pvfhj+1l9O5NTSwU4FFilPOUPYwnFWSbj uenA== 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 l69si1232558pfk.180.2018.03.27.11.00.22; Tue, 27 Mar 2018 11:00:36 -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 S1753340AbeC0R5n (ORCPT + 99 others); Tue, 27 Mar 2018 13:57:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42692 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753152AbeC0Qat (ORCPT ); Tue, 27 Mar 2018 12:30:49 -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 A81F7F0F; Tue, 27 Mar 2018 16:30:48 +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.9 02/67] iio: st_pressure: st_accel: pass correct platform data to init Date: Tue, 27 Mar 2018 18:26:54 +0200 Message-Id: <20180327162726.824005009@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@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.9-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 @@ -858,7 +858,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) goto st_accel_power_off; --- a/drivers/iio/pressure/st_pressure_core.c +++ b/drivers/iio/pressure/st_pressure_core.c @@ -678,7 +678,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) goto st_press_power_off;