Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp505333rbb; Sat, 24 Feb 2024 09:44:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUI0FnV5OlFTA8ADxFJpe/3TZam65/gWHsIb8s/Dz6AqJSdHmzFNRartK4wgOGXdxdJ/0GcbYp82AEvB8ZQ8YzNDLVa8gIL0jHHyyyLjw== X-Google-Smtp-Source: AGHT+IGtY6q0Wb+Bpn2R3Ja8EI3+GKdleTW4NM1JbkQZCdbDz2pgVN0cxaCNv24Y76H7ni5Hh96M X-Received: by 2002:a17:902:6e16:b0:1dc:82bc:c073 with SMTP id u22-20020a1709026e1600b001dc82bcc073mr1756567plk.41.1708796661824; Sat, 24 Feb 2024 09:44:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796661; cv=pass; d=google.com; s=arc-20160816; b=K2ghifEkVbp5+SdmW3/OqsNvNtDUABpt7iid2IPgrtoYQ+syjjp9G5CaO8g+jABSYc kIxJQh0CUf/53JbvJ9Co7IdswYnChSlEFy5y/d3GYSibR/9pNvjLqk9tmpdd5DUi4Ajt FBAKADJg+tx8LHqs2WrH1FDaF31VUi0VNDfVD2zb0lgJ6CwYpZqiZMidVNPeJE6ybbSd TDXtqY17rWIdmje4DLelA08bXI3WS7A4MLfy+PR0x8FxpB/i8c+h2D6efnfUzafXXe3J EINbK5aXpUffW9I3wIvv7sa8I/AEhAPjicr09R/YbXSG3goF4GdVcR0XAGbiegOX4S5g FzJQ== 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 :subject:cc:to:from:date:dkim-signature; bh=vK1HZ+1Bjw/vrLwm/6PpsZ45m9nXgo1QpyODvJbXUMM=; fh=i8N0Rer/wssDtgyvQcXngvWu7etAV7tVof4DOWYU3g0=; b=Zx28f0jT6xPADnSOPWrhHONXSzABrFQZOG1s5bNhPjY6BZu/Fc1Urpq0Jw1/apOtor CNbWxPF5aGdbKrTiEUbsyAgJDdRboZikMDshSVcecuyhfoS7cd+4K4JtNxj8xjKwcmig axfBzW30FURz0GgAl2glYeQcXi5V/4tvFjvp3I0jcfTdpkb1xIi2pVXhtVOl528xdkzu nmz5mDeultLp/EuEUsd5SxeZRmGTRCohqTAJf3q43tQvyRSVX1ZcYCak7lv7tNowCH4J qdRzrRyjZ4XbK24ZqhisLnreZ7Uy9h/NL65nLiPAundSyRfjkgB+wpz9/njnYsfe9EPI xU6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cz6jY75F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79771-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s4-20020a170903320400b001dc722a4dc1si1091588plh.9.2024.02.24.09.44.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:44:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cz6jY75F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79771-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 885E5282879 for ; Sat, 24 Feb 2024 17:44:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5516E481BD; Sat, 24 Feb 2024 17:43:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Cz6jY75F" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A85E4F5EC; Sat, 24 Feb 2024 17:43:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796580; cv=none; b=kkqAdD3PXdBeQ62ZufDsGRPxZ/zNB1XT/i0Lp4b5pOkHGzycpvsdwA/zl5UmcsNFhJTar4s/aNX7OiKmvCF1vSqu/o/5SPAGoNof5KtdSJXRwJuk8EwFbTalkhXLwXlg25qh8shSYVZc1Got4fbFg3T+e6TwjHYvZZoimG4CxTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796580; c=relaxed/simple; bh=OZAL44ygaFGSxZTGS7WKbyRSLev5JfDvm3Pr5EIKOqs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n3eCsNZtL5b4wOUL8me73s8moQD0b7h304L2Kslucde2hc/a4JqO8JzHjjuSvpNKOMCNxbtkffXTCrZHtN58YZyiOtTZy9nUKP+X62zClp/Owl1sg3HSWltQeJzt9Zz3Wrn8EReKS36ZX8dX56sLpBur7qC+qQh/vKGCSz+rrQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Cz6jY75F; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09396C433C7; Sat, 24 Feb 2024 17:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796580; bh=OZAL44ygaFGSxZTGS7WKbyRSLev5JfDvm3Pr5EIKOqs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Cz6jY75Fly44nw1hFDyfw4gCVerWm1jgiOGz8JkvWYsktVMrDeHSZS3/IS30DqEMb 4Du3oJPA/QLL1ISaZVvZWcXrJ8v2nISuoLJW8xLTV+hpn2ar3m//beo1nVyHtU7tIP Vv6fYMLjI8V6fZ1n1bwj8KxLk6+EeAH+BbVULZsTvRwSPOsnXz9QEQhru7dPiZWDmR 1JLNOzAoOK11Nsjy07lnePG4tgtVxIB4j+4rn11eOjRtKBcokuXloClDbu+sRyMPpq g/2KXGnJtwCi3wFvGKAi7mKJJ4dEcLSuWCcJ0aqWpey7Pn0jH3fFaRVMv3aTn0GrKJ EY/W1x8wOxSNw== Date: Sat, 24 Feb 2024 17:42:46 +0000 From: Jonathan Cameron To: Dumitru Ceclan Cc: Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ceclan Dumitru Subject: Re: [PATCH v5 3/5] iio: amplifiers: hmc425a: move conversion logic Message-ID: <20240224174246.63598681@jic23-huawei> In-Reply-To: <20240220153553.2432-2-mitrutzceclan@gmail.com> References: <20240220153553.2432-1-mitrutzceclan@gmail.com> <20240220153553.2432-2-mitrutzceclan@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 20 Feb 2024 17:34:49 +0200 Dumitru Ceclan wrote: > Move gain-dB<->code conversion logic from read_raw and write_raw to > chip_info callbacks. > > Signed-off-by: Dumitru Ceclan I've made a small tweak whilst applying this one. > @@ -100,36 +155,15 @@ static int hmc425a_write_raw(struct iio_dev *indio_dev, > int val2, long mask) > { > mutex_lock(&st->lock); > switch (mask) { > case IIO_CHAN_INFO_HARDWAREGAIN: > + ret = gain_dB_to_code(st, val, val2, &code); > + if (ret) > + break; > st->gain = code; > - Check your patches for unrelated white space changes. They make things a little less reviewable and they create noise in the history etc. If you want to tidy up whitespace, a single patch just doing that is the way to go. > ret = hmc425a_write(indio_dev, st->gain); > break; > default: > @@ -189,6 +223,8 @@ static struct hmc425a_chip_info hmc425a_chip_info_tbl[] = { > .gain_min = -31500, > .gain_max = 0, > .default_gain = -0x40, /* set default gain -31.5db*/