From patchwork Fri Mar 9 09:01:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nosthoff X-Patchwork-Id: 10270039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D885F60236 for ; Fri, 9 Mar 2018 09:01:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA87E2872B for ; Fri, 9 Mar 2018 09:01:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF911292FD; Fri, 9 Mar 2018 09:01:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 404BE2872B for ; Fri, 9 Mar 2018 09:01:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751238AbeCIJBl (ORCPT ); Fri, 9 Mar 2018 04:01:41 -0500 Received: from mail.stresser.de ([88.198.198.115]:48754 "EHLO mail.stresser.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751033AbeCIJBk (ORCPT ); Fri, 9 Mar 2018 04:01:40 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.stresser.de (Postfix) with ESMTP id 844F24380065 for ; Fri, 9 Mar 2018 10:01:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.stresser.de Received: from _ (frachter.heine.tech [46.4.84.91]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.stresser.de (Postfix) with ESMTPSA id A57704380064 for ; Fri, 9 Mar 2018 10:01:38 +0100 (CET) MIME-Version: 1.0 Date: Fri, 09 Mar 2018 10:01:38 +0100 From: Michael Nosthoff To: linux-iio@vger.kernel.org Subject: [PATCH 1/2] iio: accel: Revert "iio: accel: st_accel: remove redundant pointer pdata" Message-ID: X-Sender: committed@heine.so User-Agent: Roundcube Webmail/1.3.4 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 585ed27d removed code which was unused due to a bug in commit 7383d44b. To fix this bug the code is needed. Thus this revert. This reverts commit 585ed27d06151f98e39238298f43ee261314ae74. Signed-off-by: Michael Nosthoff --- drivers/iio/accel/st_accel_core.c | 5 +++++ 1 file changed, 5 insertions(+) @@ -946,6 +948,9 @@ int st_accel_common_probe(struct iio_dev *indio_dev) &adata->sensor_settings->fs.fs_avl[0]; adata->odr = adata->sensor_settings->odr.odr_avl[0].hz; + if (!pdata) + pdata = (struct st_sensors_platform_data *)&default_accel_pdata; + err = st_sensors_init_sensor(indio_dev, adata->dev->platform_data); if (err < 0) goto st_accel_power_off; diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 6fe995c..460aa58 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -920,6 +920,8 @@ static const struct iio_trigger_ops st_accel_trigger_ops = { int st_accel_common_probe(struct iio_dev *indio_dev) { struct st_sensor_data *adata = iio_priv(indio_dev); + struct st_sensors_platform_data *pdata = + (struct st_sensors_platform_data *)adata->dev->platform_data; int irq = adata->get_irq_data_ready(indio_dev); int err;