From patchwork Mon Jul 26 15:39:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 485838 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3951880jao; Mon, 26 Jul 2021 08:51:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsxRB3t4J3AnLQzhHm3ARGL5DCDJzrh9QMUpoxKaC5dowvsT6QSfzkV9LGjACSqPmF7EPG X-Received: by 2002:a05:6638:144e:: with SMTP id l14mr17157631jad.69.1627314709399; Mon, 26 Jul 2021 08:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627314709; cv=none; d=google.com; s=arc-20160816; b=yNnGPw8EOzHIai35MJATSSeEaryXubyb1HMpMw59mgZSyPYtS9XGsobU7NDyWsoBpI hQPR0Ql3rAh3pRtgZV1VTHrtBC/8c6/wOeJmZ5q9PyIG7jp6AHLHs/TREGrXAce9OFaJ 03tf+ysw14Rn49nZ/sChGUKLnFCgDxHr24N87T9OB9sSBSTuZE6ECQsafUbR+CGHl5h0 5ZB9+sVx0iokv8ApUB+8m2o35XtWXEhx7aEr8CrbkME7UDr+N3bqK4viMueK0yb8s+wV Frx9hU+euFcCzUraynofJdBOHURbB8KF8oOEJbk/jk3+CVfyTAqKCv1JD/lfk3pYQv/e NDmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=54W+jgMiaei51vRyutWvs5iZc7ezb4+Fv9aiGwIwlk4=; b=tN0rw/0E7N0bTDmOeeQZz0qZO+vJQ7A6ATQNYDIpNK/EIR0fIOzUX0zNVEcApBhstb +24WKfzT/3j2/Bq2ZJ/kX9Hdpo66iZxBYCV22VOjfFbDJoNwOu/0onmZeZaz2uoA7pLf ZEnLCZzdFgJPn/OJKdGV1w+/KN0FuFU2Ylp5vv1V69dneBM4m/kTmH+rPGeoO5TlebtM IxOnmiSKmGjPgAkJGZWwT/2Eqc0guTNi33NwyREu7PC42MGEZn8HCicemoGTLa5ER9JQ 0viB2DN8iW2RGRT4jAZZHYDTc020uSDxvfC70VlTSC0S57jGnMlNmescwVUDfTVud7pq VgdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N7uYeVBM; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si401795iov.62.2021.07.26.08.51.48; Mon, 26 Jul 2021 08:51:49 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N7uYeVBM; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236462AbhGZPLR (ORCPT + 12 others); Mon, 26 Jul 2021 11:11:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:47774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236386AbhGZPIQ (ORCPT ); Mon, 26 Jul 2021 11:08:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0997360F9F; Mon, 26 Jul 2021 15:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627314520; bh=YH+VDSWyxvMW7UBNTSI85qMRrwWMIYiZtz6Avz72yGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N7uYeVBM+UPXSfubAFMysOVHU+2yQK0Pb7sLPFUT44pksjbIdWXf3T3k22qLQ5XWj LXN+lDCaoR48xWtrhBsS4AV0SKN2x1bx/sfWbkzL6m9GtvIY2GojV9TzeqVnyM6wVD dw3yqerDbGQRzUt0jbJBVABuQvpO2/oguXGjvTGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Meerwald , Oleksandr Kravchenko , Linus Walleij , Jonathan Cameron , Sudip Mukherjee Subject: [PATCH 4.14 78/82] iio: accel: bma180: Use explicit member assignment Date: Mon, 26 Jul 2021 17:39:18 +0200 Message-Id: <20210726153830.714268205@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153828.144714469@linuxfoundation.org> References: <20210726153828.144714469@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij commit 9436abc40139503a7cea22a96437697d048f31c0 upstream This uses the C99 explicit .member assignment for the variant data in struct bma180_part_info. This makes it easier to understand and add new variants. Cc: Peter Meerwald Cc: Oleksandr Kravchenko Signed-off-by: Linus Walleij Signed-off-by: Jonathan Cameron Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/iio/accel/bma180.c | 68 +++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 24 deletions(-) --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -626,32 +626,52 @@ static const struct iio_chan_spec bma250 static const struct bma180_part_info bma180_part_info[] = { [BMA180] = { - bma180_channels, ARRAY_SIZE(bma180_channels), - bma180_scale_table, ARRAY_SIZE(bma180_scale_table), - bma180_bw_table, ARRAY_SIZE(bma180_bw_table), - BMA180_CTRL_REG0, BMA180_RESET_INT, - BMA180_CTRL_REG0, BMA180_SLEEP, - BMA180_BW_TCS, BMA180_BW, - BMA180_OFFSET_LSB1, BMA180_RANGE, - BMA180_TCO_Z, BMA180_MODE_CONFIG, BMA180_LOW_POWER, - BMA180_CTRL_REG3, BMA180_NEW_DATA_INT, - BMA180_RESET, - bma180_chip_config, - bma180_chip_disable, + .channels = bma180_channels, + .num_channels = ARRAY_SIZE(bma180_channels), + .scale_table = bma180_scale_table, + .num_scales = ARRAY_SIZE(bma180_scale_table), + .bw_table = bma180_bw_table, + .num_bw = ARRAY_SIZE(bma180_bw_table), + .int_reset_reg = BMA180_CTRL_REG0, + .int_reset_mask = BMA180_RESET_INT, + .sleep_reg = BMA180_CTRL_REG0, + .sleep_mask = BMA180_SLEEP, + .bw_reg = BMA180_BW_TCS, + .bw_mask = BMA180_BW, + .scale_reg = BMA180_OFFSET_LSB1, + .scale_mask = BMA180_RANGE, + .power_reg = BMA180_TCO_Z, + .power_mask = BMA180_MODE_CONFIG, + .lowpower_val = BMA180_LOW_POWER, + .int_enable_reg = BMA180_CTRL_REG3, + .int_enable_mask = BMA180_NEW_DATA_INT, + .softreset_reg = BMA180_RESET, + .chip_config = bma180_chip_config, + .chip_disable = bma180_chip_disable, }, [BMA250] = { - bma250_channels, ARRAY_SIZE(bma250_channels), - bma250_scale_table, ARRAY_SIZE(bma250_scale_table), - bma250_bw_table, ARRAY_SIZE(bma250_bw_table), - BMA250_INT_RESET_REG, BMA250_INT_RESET_MASK, - BMA250_POWER_REG, BMA250_SUSPEND_MASK, - BMA250_BW_REG, BMA250_BW_MASK, - BMA250_RANGE_REG, BMA250_RANGE_MASK, - BMA250_POWER_REG, BMA250_LOWPOWER_MASK, 1, - BMA250_INT_ENABLE_REG, BMA250_DATA_INTEN_MASK, - BMA250_RESET_REG, - bma250_chip_config, - bma250_chip_disable, + .channels = bma250_channels, + .num_channels = ARRAY_SIZE(bma250_channels), + .scale_table = bma250_scale_table, + .num_scales = ARRAY_SIZE(bma250_scale_table), + .bw_table = bma250_bw_table, + .num_bw = ARRAY_SIZE(bma250_bw_table), + .int_reset_reg = BMA250_INT_RESET_REG, + .int_reset_mask = BMA250_INT_RESET_MASK, + .sleep_reg = BMA250_POWER_REG, + .sleep_mask = BMA250_SUSPEND_MASK, + .bw_reg = BMA250_BW_REG, + .bw_mask = BMA250_BW_MASK, + .scale_reg = BMA250_RANGE_REG, + .scale_mask = BMA250_RANGE_MASK, + .power_reg = BMA250_POWER_REG, + .power_mask = BMA250_LOWPOWER_MASK, + .lowpower_val = 1, + .int_enable_reg = BMA250_INT_ENABLE_REG, + .int_enable_mask = BMA250_DATA_INTEN_MASK, + .softreset_reg = BMA250_RESET_REG, + .chip_config = bma250_chip_config, + .chip_disable = bma250_chip_disable, }, };