From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 47CEF403B0D for ; Mon, 20 Jul 2026 16:50:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784566235; cv=none; b=nHmcl5vtN59R36cLLkICIhcSxmYpVK3mI7KQFQDKUlVWH7Vbv0haCuKeHrPPsMoF+HIrhlD2KmW+o5kk+BQ5yM7/0Xy7fGA4yq907Oe5RQV13ax8SvxrM5JWxE83veetjzGMhgAYvr9xnz4nQcKsjhVvIv4lhjff4N3xw06yHeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784566235; c=relaxed/simple; bh=xLj8gVdARFZvL7dMaAwyCyeARyxXEU4B3zwUZPi/zlk=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=P/JcIdC8AhL5I6mcrAbT5Uh9I+233C0TPrX32cGKYCmK3yAk04Kkj1mofbl3Ppt6DEmldz06LoXqimdfdmVHCJDG0mSpQ8tbX1s/v5+hTNI8PUZtWFj3tWk2BaSGqEYx2MtutmOIQbyQdTJcxVRgMiF1apZ/vIRdR2laDvvegGY= 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=CxgjVmxL; arc=none smtp.client-ip=209.85.216.54 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CxgjVmxL" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-384c94c9414so5908182a91.3 for ; Mon, 20 Jul 2026 09:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784566234; x=1785171034; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id :references:in-reply-to:user-agent:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to:content-type; bh=E9JE/eR+ETc25R/xPipwqaolcgylczRQleB6t8SczIQ=; b=CxgjVmxLrj4zWpRiA52rv2BC1lJOLzgDZBogublJPBkKVnWy4wyTYesnTvFQVa0xb0 uuYiDISHcr8BSjVNF/1g73AFBWwL5Lyq16l7ks+X2bDJXlgzVI+HhtZv3sUq7KGQ/fq/ jLweqAUIfY5UElnkmBZgYItFD1+sANchyZfopO3Fc/eLqD7ODxvAU/R2rnvscbk4S8RS VmjVPBVbTc5dytPkuSGtPt4kgOy68Xiy8wWTIVNgaemaYVId+rmU+JbK28P5zeEncNnm 42Uy2CiE0mcO7uzhp5ZT74pihjL2N7Fyxs0NllDvtkMd6Hky9bUbPVSS8ws7BM/EPlwJ xeyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784566234; x=1785171034; h=content-transfer-encoding:content-type:mime-version:message-id :references:in-reply-to:user-agent:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=E9JE/eR+ETc25R/xPipwqaolcgylczRQleB6t8SczIQ=; b=rnYrDSgj9tq2QskGpSSxd69KxuHgttI6z/xsnlL985SvqxIFlVfV6b0e8Q0pA1xDpA +hSRRrl93tfUThCRhK+61FGLq/Ktg6F5rCk9wos1r/wSGW/qj9CLbRnvLziH8pN8C1Qr gzIX5AmOFaLSq2O16pkkZ53MfCwhWmKvOcJFUfOq2sdaefzHP/+HJc4cEgE9tdXk2uZO xxOP/nX9UcdNlmJMAXB+Rx3SU9DmGAhxCkonmQzC8r4badgSnS2BcwUD96N7LZZon56j UukUeU/gTa6ltQlO49hSRRJju/Ge+60er/l7aJ3FK7nBcBAcLKGP1eJyJ2GMExOjAj4p TZ5Q== X-Forwarded-Encrypted: i=1; AHgh+RryfCk49TucYbKbCEwq0AOrtUWUU7KeBjPZ3xz4JckoRyUVRA++NyBDQF/IFX9UGr7GvJGSIZCuVrlrGGU=@vger.kernel.org X-Gm-Message-State: AOJu0YyjWJ5cUUCLYn0TiJcSIAO2jUf5j6Zfq6OI7SG8d+QWaeruu2cT HP4ecyrYzyuRXDSBxzO9f2Vd6sbNlO4zHuFaUrZmevxn/5vecHdq2I+c X-Gm-Gg: AR+sD138mBRR+gvJq5P98WZa8IOEiYLuFnNPJaAqHwkyBraTmKkRa8a3y5+gIEgV01/ 8cTtrefX6OOSyZm9N1ymtdbG8tTXKgFlb6s8rogLNnMlNprpgbGQn+yMcICjV9FuV0bP4oD/Xw4 illKq0Ml5mA+BRMF4ZsCvwBSElL2OOl0DtTqj7mSjwJ9Zfa/bxf+Hxmv5ZzsVh1RYnrnu+sG+0T kkkqovG6PjjL2BJ3fJTlYO6ojOFqanxHinfBgaz8FWmuYp+s7r7baytsMusc6cKrrMY1I0DR9Ne +T3SJDFeZGgdFN2qRB+3IkW0o9fTi3gt3DXwlg4yuag9zuW91bVfP/dkj8FZIQzFF0Q7DLYMjlc lffIzOuJstuTcWcABdgC+JC0RWTdm2k6/fKzz7lmwQUeuPNlWx2XJMMdkIJJdNSpO2kBUR73nAP //KD7p1VfReL2gMgdlqQd4WpHXlg== X-Received: by 2002:a17:90a:d44e:b0:38d:ddc2:7ccb with SMTP id 98e67ed59e1d1-38e4b3d0fdamr14849441a91.1.1784566233232; Mon, 20 Jul 2026 09:50:33 -0700 (PDT) Received: from ehlo.thunderbird.net ([2401:4900:1f3f:a2a5:2929:50ea:668d:9415]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13ce2a129f3sm30207025c88.7.2026.07.20.09.50.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2026 09:50:32 -0700 (PDT) Date: Mon, 20 Jul 2026 22:20:28 +0530 From: Sanjay Chitroda To: Andy Shevchenko CC: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , David Lechner , =?ISO-8859-1?Q?Nuno_S=E1?= , Andy Shevchenko , linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_02/10=5D_iio=3A_gyro=3A_hid-sen?= =?US-ASCII?Q?sor-gyro-3d=3A_use_local_struct_device?= User-Agent: Thunderbird for Android In-Reply-To: References: <20260720-hid-iio-local-struct-device-v1-0-74496fee6327@gmail.com> <20260720-hid-iio-local-struct-device-v1-2-74496fee6327@gmail.com> Message-ID: <1E009860-0A0F-4F8D-8017-CE5739F22144@gmail.com> 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=utf-8 Content-Transfer-Encoding: quoted-printable On 20 July 2026 5:24:33=E2=80=AFpm IST, Andy Shevchenko wrote: >On Mon, Jul 20, 2026 at 03:10:14PM +0530, Sanjay Chitroda via B4 Relay wr= ote: > >> Introduce a local struct device pointer derived from &pdev->dev=2E >> This avoids repeated &pdev->dev usage and improves readability=2E > >=2E=2E=2E > >> if (ret) { >> - dev_err(&pdev->dev, "failed to setup common attributes\n"); >> + dev_err(dev, "failed to setup common attributes\n"); >> return ret; > >Nope, First one (to eliminate a lot of churn) should be to convert this a= nd >similar to use > > return dev_err_probe(=2E=2E=2E); > Hi Andy, Thank you for your input=2E I'm planning to have a incremental series: first introduce a local "dev" p= ointer, then convert the resource management to "devm_*", and finally repla= ce the remaining error reporting with "dev_err_probe()"=2E This keeps each series focused and avoids introducing intermediate pattern= s such as: ret =3D dev_err_probe(dev, ret, =2E=2E=2E); goto error; Once the cleanup paths are removed, those sites naturally become: return dev_err_probe(dev, ret, =2E=2E=2E); Does this approach sound reasonable? >> } >> =20 >> - indio_dev->channels =3D devm_kmemdup(&pdev->dev, gyro_3d_channels, >> + indio_dev->channels =3D devm_kmemdup(dev, gyro_3d_channels, >> sizeof(gyro_3d_channels), GFP_KERNEL); >> if (!indio_dev->channels) { >> - dev_err(&pdev->dev, "failed to duplicate channels\n"); >> + dev_err(dev, "failed to duplicate channels\n"); > >And this kind of messages are dead code and must be just removed complete= ly=2E > >> return -ENOMEM; >> } > >=2E=2E=2E > >Please, revisit the whole series=2E Yep, understood=2E I'll revisit series, drop dead code and send v2=2E Thanks, Sanjay >