Received: by 2002:ac8:3b51:0:b0:3f3:9eb6:4eb6 with SMTP id r17csp2765484qtf; Mon, 12 Jun 2023 09:43:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Q7lzh+pOo5iHqIwgTFToX8FeJEL6iSNa/7aKmOCp+eQyRmqHbv8sSV/n0RrQIeFkMygLN X-Received: by 2002:a17:90a:195a:b0:256:4189:2b0d with SMTP id 26-20020a17090a195a00b0025641892b0dmr8612873pjh.12.1686588201177; Mon, 12 Jun 2023 09:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686588201; cv=none; d=google.com; s=arc-20160816; b=mDuUfPIJJWDehp+qJFuAu6iB42VRe+j41vMoFvJbR8fwWgn6xJtmBuLL5qQmRCZN88 HNBAOmhpf+D/X2QDuMMBqoRKk8e18EsVvJ4VPP2g3mMwPeSpPqE81at7VG2vns3A8V4E PxDWq7veIRNJLUqE1DDWNXd+vvOEIZ3lGkVDPDnvDlWc99RfgiWjlexYGzHdH9SJBgsz 7jYDYldmjkKMDT9k6kzZ16TDr/t6misaYfI32nnML5AUSbrz/72imduaUIiuxjnX6/qU hxrTfwFvcjqnHD+1fttzywn1K8SXs0oscQpyVkeGtzc8JZZRfPgPgGcl++GLv1F8dL86 FDSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KplW8sCfNenzA/SzJZNtlWjCWwjIb58YD11i9Q4q5rA=; b=eTCaSSZjdz/AP0Kk6MMUeq7seVz8lUhsyG5UmthGrCyXXqA7PxSY0LJO3167be/FVd MGjVlATctwq2enM17yReHUTCW22VLyyxSRk243SyKBddWDckXjsxWEGWJht1hNyvi+wH 3xpLLlQjdrOyqRwTSdppVySEGN8N+LEhEUNpmbva1NsWALNSn2kVte9IvqsN3vKn3bl8 l4Nkug/bcKymrszT4kmFNjb9obqNKS0/bhPNqwcNf7yDb00gHEr7i7tbU2/BpHjiaj6b sMWt5loTYN2EATcVYsROzgchbGxDph/i6kjsCiCq6Y8+x3m8jnFopXI7Ksc/D3kp9B3K mACw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="gIIS/wMU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu13-20020a17090b388d00b00255ab0ed47asi7381123pjb.49.2023.06.12.09.43.04; Mon, 12 Jun 2023 09:43:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="gIIS/wMU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233151AbjFLPzN (ORCPT + 99 others); Mon, 12 Jun 2023 11:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238581AbjFLPyz (ORCPT ); Mon, 12 Jun 2023 11:54:55 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81D151A7; Mon, 12 Jun 2023 08:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686585293; x=1718121293; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=OmlB9fd/SZKZioKkBBkhE9JBfd98aiviiICcFmjDiWY=; b=gIIS/wMUMFuxnyrbV9XArR4UzeO/AFybXTTXXDWky4UbOZLXODzHn9u4 yR82EfmkXTVB86EDI2QemNBjvcuIxofGCalkbct6ID6BPP7LrUyhXNSq8 c7LFrD7jjUAl3FEgLY6rzfRu7FMxARBC1KLC/IaNl8nNXv6H9a4D8D180 ihUklHNUf7bX1aCdzXyZMPuqkRz+jFc2oZy3jUzhCDuGc3s2lC47pJM97 3bonIZHLefoy7T49Zf3MT1b2TF4tGWoiGAGkdrTzUkbjOy9tENDLQQxCJ GYpN9hXsU8wDpz6vNv+LVk7cwO9wbwzQjXKoRWXX5efym2QkdD/9Zem40 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="358080099" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="358080099" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 08:54:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="711257660" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="711257660" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga002.jf.intel.com with ESMTP; 12 Jun 2023 08:54:36 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1q8jsJ-0039Us-0I; Mon, 12 Jun 2023 18:54:35 +0300 Date: Mon, 12 Jun 2023 18:54:34 +0300 From: Andy Shevchenko To: Mehdi Djait Cc: jic23@kernel.org, mazziesaccount@gmail.com, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, lars@metafoo.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v5 5/7] iio: accel: kionix-kx022a: Refactor driver and add chip_info structure Message-ID: References: <3a41a5ae9857cacdb062c398715a5938ccd47014.1686578554.git.mehdi.djait.k@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3a41a5ae9857cacdb062c398715a5938ccd47014.1686578554.git.mehdi.djait.k@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 12, 2023 at 04:22:08PM +0200, Mehdi Djait wrote: > Add the chip_info structure to the driver's private data to hold all > the device specific infos. > Refactor the kx022a driver implementation to make it more generic and > extensible. ... > + chip_info = spi_get_device_match_data(spi); Missing check. You addressed only I?C case. Is there any explanation? ... > struct kx022a_data { > + const struct kx022a_chip_info *chip_info; > struct regmap *regmap; I would suggest to run bloat-o-meter with this version and if you place chip_info after regmap. Does it gain us some memory? > struct iio_trigger *trig; > struct device *dev; -- With Best Regards, Andy Shevchenko