From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (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 0AFBC149C4A for ; Sun, 10 Nov 2024 19:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731268359; cv=none; b=Y+4dD6u9buluSwEeLPnmvtgQsHBgBLE0zFBD2uJyaED0jExQnoY+ytdXcg1Qa9RZeo/r6dmO7bbruIf8rgC9zbNfWW1O8kxyePnF2P1VfzVJjlQAtYcRsFvFAcN0XwmCUwApyT9xkD2u+Nrl0CnfMKlUdgqThdB3DUJTiV/Abbs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731268359; c=relaxed/simple; bh=9Z/pDoqd+qplmP5YdyAJMIIHWDi+W2hpCCQf7xbBy0c=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RtwfRh+UODAvNEYghLkQG9DsZHiMUPIRz1CGlnCR3AnQUQ5tR0B6O97z5/1Vuk8jAB5Xo8XfMka6OF13DC+nUX5T5K1z7bGNNy/6TYm4qVg9a/1Ja+JCkQc0RIimbpvJr5JaGmis+GOlF4TLw/zhETSpX7q1ktezgu+4fd3p8OM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-24-75.elisa-laajakaista.fi [88.113.24.75]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 5376b6f1-9f9d-11ef-8874-005056bdd08f; Sun, 10 Nov 2024 21:52:33 +0200 (EET) From: Andy Shevchenko Date: Sun, 10 Nov 2024 21:52:32 +0200 To: Aren Cc: Andy Shevchenko , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Kaustabh Chakraborty , =?iso-8859-1?B?QmFybmFi4XMgQ3rpbeFu?= , Ondrej Jirman , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Dragan Simic , phone-devel@vger.kernel.org Subject: Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible Message-ID: References: <20241102195037.3013934-3-aren@peacevolution.org> <20241102195037.3013934-11-aren@peacevolution.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sun, Nov 10, 2024 at 02:14:24PM -0500, Aren kirjoitti: > On Mon, Nov 04, 2024 at 10:40:16AM +0200, Andy Shevchenko wrote: > > On Sat, Nov 02, 2024 at 03:50:41PM -0400, Aren Moynihan wrote: ... > > > #define STK3310_REGFIELD(name) \ > > > do { \ > > > data->reg_##name = \ > > > - devm_regmap_field_alloc(&client->dev, regmap, \ > > > + devm_regmap_field_alloc(dev, regmap, \ > > > stk3310_reg_field_##name); \ > > > - if (IS_ERR(data->reg_##name)) { \ > > > - dev_err(&client->dev, "reg field alloc failed.\n"); \ > > > - return PTR_ERR(data->reg_##name); \ > > > - } \ > > > + if (IS_ERR(data->reg_##name)) \ > > > > > + return dev_err_probe(dev, \ > > > + PTR_ERR(data->reg_##name), \ > > > > AFAICS these two can be put on one. > > This doesn't leave room for whitespace between the end of line and "\", Is it a problem? > replacing "do { } while (0)" with "({ })" and deindenting could make > enough room to clean this up the formatting of this macro though. do {} while (0) is C standard, ({}) is not. > > > + "reg field alloc failed.\n"); \ > > > } while (0) -- With Best Regards, Andy Shevchenko