From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0402CC3ABA2 for ; Mon, 16 Sep 2024 10:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=o+7rcnYU9Xh7cExHFukAZWKlohG30FdP/pjZcJMgJMI=; b=bdl/VbUMb76ITBSSfuQJXT5LwR aiu95eXcbKZLSHrMbPl99h4S8XiIAXfrHnoNg3XOU1U79H+pMzWbxcD7hDW5gaOyHZlKhnwkM2qSz YfmsVyTz7k12DOMHp/nG0FTv8DMutI2IQEURT+QiTQuSbNdRfCFB7XI18wowqV0cVOJUo2YEEL/xg mOBNkpZz1knXct682acGwpEf1Jqu112vd/tOKVRf27EDfCmyVPGH4p9fRKWk9TqsljlkWC7nbvSvH V0LxT+JB3HRWaHIORLpsHmD7sEnFNHovD+OZ5c2PoN3ShPJHW0cs1WpllutEzS+IclZck3xjQTLKN Olro5MEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sq8kv-00000003fW2-301K; Mon, 16 Sep 2024 10:14:53 +0000 Received: from mgamail.intel.com ([192.198.163.8]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sq8jl-00000003fAz-3CRR; Mon, 16 Sep 2024 10:13:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726481622; x=1758017622; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=AJClUZHkcOc0nIkFKgtMeGqAt/Ij2O5DgRNhQvRHDw4=; b=Pfo7Hqv045ACqLVfMJZyhVER9wA0c6LnqJkZthK5K9bKJtcy17L6205J epbJLLOPyGyxNDkgb9BK0dXIoC2PdtpTwJ9cNiwU2bOO5IOvnQGeg+14m AtltoAfQ1/hE1kdphmd2W1WYyRMd/INkZdA9iA6RjU0Ed/SUvOvuunncu Ww7VIurBJS/7ruBSpIzV/U72nL8IHUAXN6d5pZq2N1rK+xYRIN6Rp3VJy tyZL9uCc4rGXCb/oqik0hDcO8fgkVpPH/V+ybF1L1M40voRUrCiTaUJP5 98HEHc5u3kC40ZuygBW2j9CbGO06wDCY4jbQKNIPoPqgXefa/afLonOGa g==; X-CSE-ConnectionGUID: ze6G2lKXTa2SLH++nZJg1w== X-CSE-MsgGUID: 1wXCIeZnTJq7TRkdFss4DA== X-IronPort-AV: E=McAfee;i="6700,10204,11196"; a="42815763" X-IronPort-AV: E=Sophos;i="6.10,233,1719903600"; d="scan'208";a="42815763" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2024 03:13:38 -0700 X-CSE-ConnectionGUID: 6/QFDO/ZT/CAOga95eN+gA== X-CSE-MsgGUID: 9nXYsiyvTTC1+eAvvYp/Xg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,233,1719903600"; d="scan'208";a="73419425" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2024 03:13:34 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.98) (envelope-from ) id 1sq8jb-00000009Pyj-0z7J; Mon, 16 Sep 2024 13:13:31 +0300 Date: Mon, 16 Sep 2024 13:13:30 +0300 From: Andy Shevchenko To: Doug Anderson Cc: Chen-Yu Tsai , Rob Herring , Saravana Kannan , Matthias Brugger , AngeloGioacchino Del Regno , Wolfram Sang , Benson Leung , Tzung-Bi Shih , Mark Brown , Liam Girdwood , chrome-platform@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold , Jiri Kosina , linux-i2c@vger.kernel.org Subject: Re: [PATCH v7 06/10] i2c: Introduce OF component probe function Message-ID: References: <20240911072751.365361-1-wenst@chromium.org> <20240911072751.365361-7-wenst@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240916_031341_872254_01FC9D61 X-CRM114-Status: GOOD ( 13.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 13, 2024 at 04:43:04PM -0700, Doug Anderson wrote: > On Wed, Sep 11, 2024 at 12:28 AM Chen-Yu Tsai wrote: ... > > +static int i2c_of_probe_enable_node(struct device *dev, struct device_node *node) > > +{ > > + int ret; > > + > > + dev_info(dev, "Enabling %pOF\n", node); > > + > > + struct of_changeset *ocs __free(kfree) = kzalloc(sizeof(*ocs), GFP_KERNEL); > > + if (!ocs) > > + return -ENOMEM; > > I guess the kernel lets you mix code and declarations now? I'm still > used to all declarations being together but maybe I'm old school... I > would have put the "dev_info" below the allocation... In general yes, but we don't allow it everywhere for everything, we have two exceptions: 1) for-loops; 2) __free() RAII. -- With Best Regards, Andy Shevchenko