From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 C062F145348 for ; Sun, 10 Nov 2024 19:52:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731268370; cv=none; b=rSWi3h+q/B8Na4gGcC8opbwMf8NqcbY5zxSYvq9CY53wgR75qV4a9lq0w/UTzq0lONjU6FrZo64TbZId1qt/x17lvBEIk1qTlqZGs0I9TpvDMQYYhkIAtg29vCmQPO50JA454QHB+kuVJQ4dGlPK+LX0dLCwiDaJPoiayIf3qms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731268370; 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=XxXIXF/WFBn5HfJmJz6F7RF7Smq3Rcc3+IKaxC7uyTJTVd+fpMtNKIvD1jmsmaenxYpiVlaKGCzotW0gQuhy5Q1G7UcsnNT8BIOKee7DNLiwEBJdLBXtRZ9wTwQ3Yblpq1hSsIRFUapTTHqhWNfSc9hcINvDy/mRsoOsXOIpqhs= 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.82 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: devicetree@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