Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp799453lqh; Thu, 28 Mar 2024 17:49:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXPe22Z6+2pxbulflS4SkA2+om6L+JPAcCXdubcsQegWIuwkvDmZh18SKfszEXduBaO/Zoozhik0fJA4OFgWz8zJtddjMn2H6ttwb27A== X-Google-Smtp-Source: AGHT+IFO8q7sA1xWQtNCtETXzjxoVxFXGEvGpnJHDy4ZMBVYeSYbXPr1g/a7sJTD0HqWlQ9Xx4Su X-Received: by 2002:a05:6a20:43a0:b0:1a3:af3e:1c87 with SMTP id i32-20020a056a2043a000b001a3af3e1c87mr1093066pzl.11.1711673393633; Thu, 28 Mar 2024 17:49:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711673393; cv=pass; d=google.com; s=arc-20160816; b=pgLCFkPBc8RFv4/rRc/z1HtEhlzcnzqTn2e7Ao13wX0DFKEcM+pH1NJawUb8zU9loM ZwpvPJNCAQWi8H9vjhSuMGQRi8W5o/dOsvOUWwjJKaaOudLNEOnUECbIKDcdpPyrs44F zkW8T3e+30Z8ujLOaLaTVv5E3Pi/o/LmHKZZ261mctqurJ5aoyGRr86+zL8Fok2nxEHE tO7I6yQJX30U8wLz3Z9KKOe0+c7OTgdmIsw5dXEaNzuTcmJchslKYBVJE3iqvFc0ndH7 /ykHDPBvCeAzbaw2uI4n7/kK/qQEU0uti8tWi/ZHoAL6LIZ3iyvTzt/SC4Vp9AbM7aMd dIqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xiaRmyfs00yXQyFJiot+MPjs/cJdjRS0zbVlH6tELQU=; fh=FK1/qKJFC4y6yFv9FGxplkhCmTGaG8MTnpF3ut6UoIs=; b=umB4E+OMlEI/Qoi/3XC3q4bTFHupJM6pa1Fuxk0XqwslLEEStvssTxu46Zhzwnx0mW rIlFEYOnDOsLSzbkI3ItilYVv/yHl/HZq8Di8Jq/bICyFBERxoNnI04Zi81f8/uXTiE7 zXp1M//we3gzfWsn0d2YWARAQL2Nd6r2/rkpKm9y7FH9P312Vecwj5pWMf38rGrA1UMx 2f7tEULw+l+rhku5n4UX8cRWJJbYkfP5NdOjhfn+jsQ2Cyy7JhR51U4yQChYGYoadot6 wxwHMDwUfSRjl1g6QdCOkoQkknZlhRVMr0NRd8VrrhGoPdW0Rnd97KGdlqjeX3tlJnjq TAFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HVMR6B+X; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123917-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d13-20020a170903230d00b001e00f3fd38fsi2514695plh.285.2024.03.28.17.49.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 17:49:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123917-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HVMR6B+X; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123917-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2DCA328FA34 for ; Fri, 29 Mar 2024 00:41:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D54101E504; Fri, 29 Mar 2024 00:40:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HVMR6B+X" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5944411720; Fri, 29 Mar 2024 00:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711672844; cv=none; b=SgsfRiv/sHUilWukwXWXDHPDy8p9Nm0SeCth/1cjvUl3s1ohfKnKLfMShNhp1SXS8shI3YnFX5srIs/tJO9BjBGXXM6JHKn7BpogD+avsuqIdPbWZbIHNZtEdlQ3sF0r3BQcni6ISwds4Ng89lJf/YIhf64yLCeU8JhyfUN5iHw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711672844; c=relaxed/simple; bh=HHf07n/B+1VkiALybuaC6O5pR6Els/Bni9LZ9AlsDXo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WvZ/ihiZd4LcPpwYunvV0Nri5ZTkfLI80BFqeVqykcW2eNzautNy/gLB9Ay0Wv10bxz5D90DMDcCTBwKQsvu0KeMzCLQZzXcF/BSMYwS3MQCUGBdrvGHDEp0KaTJVpOnu2wniSVFVVe3ar06yTtQ5twPTweMr8mtRtbvimyipOQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HVMR6B+X; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-56bc5a3aeb9so1935746a12.3; Thu, 28 Mar 2024 17:40:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711672840; x=1712277640; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xiaRmyfs00yXQyFJiot+MPjs/cJdjRS0zbVlH6tELQU=; b=HVMR6B+XDlono+CJhQCW+jbew17aKuv5Hsg51FdRyz5+Atlrb6UKdsqlpjCcMmxYgP WcUogOcoQNY8p8Qb2mgsu94Y4JNYEyhJs979vWYyctEIEog2RHDzK7R6Ydhlk/DsDZZS iSxwckIDWdZk6gF+fGntvo30od0CXcbjlXrzSWugxSQe1T072LOateBNQB1wMF/Rg+4d 6BXIJrazyfyPUFHsmV1ufBLcNpcmOLYFfIe5rQE7a8KN10YHqagQ3aEM3lrX83dkS8dF vgpl0Z3/oILmDU7m/HkKGQ1EHIj8HrB6y9TW1Ii47ASSmnU/7Cr9rGuSkVUFIUmOrbJJ EMdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711672840; x=1712277640; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xiaRmyfs00yXQyFJiot+MPjs/cJdjRS0zbVlH6tELQU=; b=GfhEacjuQT4wUQePYYuhy5sN3vx9oO3w/Q+mjI4CJU6vxvPj700Vg4B5N99grRj7OX yY+lQ7q+DPMNAs6jWuRuQW8XivssarpF8vbgtuHd3By6ZOdluT8CJ8gaPyMFeFswMdsg hZRZ7OAQnKG+q4sdV4e/X0Dgs+JpkFWH1q1h6efNRLMtzDsX028wNip5PDVHIyYlEv0C VY8CA0RHG5xwju9ju6XcWHJb+BfVUqCDnzXBmOWi0GogX1VXCIeX0fK03/vxbzrtTlw+ 7qSytZoQB3aYZHo1w4+Ws+qucsS/cWh5yUxxNHg7O0KnXeujs9Q350s2Jbxqh749ZUws ggaA== X-Forwarded-Encrypted: i=1; AJvYcCXUCsHuuPceJHUqpk9g4VHAX74YRUD6ZzuWpiqZIT4Y4ki2ed8gdr1pYu5X03xNhVL8o945uBRPTQfCkMNzjxK6UIOhgrQOXiAD1fvaAMugoGNwfAYAp+texD3SxwdF2Wa1dKkcT4o6kQ== X-Gm-Message-State: AOJu0YzFOGMZvjYpGtoExfIBtLgjEjlnDXMKfmPMhG+0kbtMzwJ4idxi 6o+uScmPg9JcwjqwKX+lYhILRLxfO8Q6mMfIdJRKT6/rrfalud9I X-Received: by 2002:a50:ccdd:0:b0:568:b41b:afd7 with SMTP id b29-20020a50ccdd000000b00568b41bafd7mr471627edj.29.1711672839536; Thu, 28 Mar 2024 17:40:39 -0700 (PDT) Received: from 13a4f82a8f12.v.cablecom.net (84-72-156-211.dclient.hispeed.ch. [84.72.156.211]) by smtp.gmail.com with ESMTPSA id h7-20020a0564020e0700b00568e3d3337bsm1391679edh.18.2024.03.28.17.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 17:40:39 -0700 (PDT) From: Lothar Rubusch To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, eraretuya@gmail.com, l.rubusch@gmail.com Subject: [PATCH v6 2/7] iio: accel: adxl345: Group bus configuration Date: Fri, 29 Mar 2024 00:40:25 +0000 Message-Id: <20240329004030.16153-3-l.rubusch@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240329004030.16153-1-l.rubusch@gmail.com> References: <20240329004030.16153-1-l.rubusch@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Group the indio_dev initialization and bus configuration for improved readability. Signed-off-by: Lothar Rubusch --- drivers/iio/accel/adxl345_core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_core.c index f4dec5ff1..78ac6ea54 100644 --- a/drivers/iio/accel/adxl345_core.c +++ b/drivers/iio/accel/adxl345_core.c @@ -226,6 +226,12 @@ int adxl345_core_probe(struct device *dev, struct regmap *regmap) if (!data->info) return -ENODEV; + indio_dev->name = data->info->name; + indio_dev->info = &adxl345_info; + indio_dev->modes = INDIO_DIRECT_MODE; + indio_dev->channels = adxl345_channels; + indio_dev->num_channels = ARRAY_SIZE(adxl345_channels); + /* * Only allow updates of bus independent bits to the data_format * register. Keep the bus specific pre-configuration. @@ -241,12 +247,6 @@ int adxl345_core_probe(struct device *dev, struct regmap *regmap) if (ret) return dev_err_probe(dev, ret, "Failed to set data range\n"); - indio_dev->name = data->info->name; - indio_dev->info = &adxl345_info; - indio_dev->modes = INDIO_DIRECT_MODE; - indio_dev->channels = adxl345_channels; - indio_dev->num_channels = ARRAY_SIZE(adxl345_channels); - /* Enable measurement mode */ ret = adxl345_powerup(data->regmap); if (ret < 0) -- 2.25.1