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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1602C4332F for ; Fri, 16 Dec 2022 13:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230389AbiLPNyq (ORCPT ); Fri, 16 Dec 2022 08:54:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiLPNyo (ORCPT ); Fri, 16 Dec 2022 08:54:44 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977C74D5E4; Fri, 16 Dec 2022 05:54:43 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10563"; a="299307729" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="299307729" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 05:54:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10563"; a="738545598" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="738545598" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 16 Dec 2022 05:54:35 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p6BAX-00AsfL-2d; Fri, 16 Dec 2022 15:54:33 +0200 Date: Fri, 16 Dec 2022 15:54:33 +0200 From: Andy Shevchenko To: Hans de Goede Cc: Mark Gross , Pavel Machek , Lee Jones , Linus Walleij , Daniel Scally , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , platform-driver-x86@vger.kernel.org, linux-leds@vger.kernel.org, linux-gpio@vger.kernel.org, Kate Hsuan , Mark Pearson , Andy Yeh , Yao Hao , linux-media@vger.kernel.org Subject: Re: [PATCH v3 02/11] leds: led-class: Add __led_get() helper function Message-ID: References: <20221216113013.126881-1-hdegoede@redhat.com> <20221216113013.126881-3-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221216113013.126881-3-hdegoede@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org On Fri, Dec 16, 2022 at 12:30:04PM +0100, Hans de Goede wrote: > Split out part of of_led_get() into a generic __led_get() helper function. > > This is a preparation patch for adding a generic (non devicetree specific) > led_get() function. ... > +static struct led_classdev *__led_get(struct device *led_dev) > +{ > + struct led_classdev *led_cdev; > + > + if (!led_dev) > + return ERR_PTR(-EPROBE_DEFER); > + > + led_cdev = dev_get_drvdata(led_dev); > + > + if (!try_module_get(led_cdev->dev->parent->driver->owner)) { > + put_device(led_cdev->dev); > + return ERR_PTR(-ENODEV); > + } > + > + return led_cdev; > +} If I'm not mistaken, the entire series leaves this function as is. At the end I found three _get functions: __led_get led_get __devm_led_get As far as I can see the above can be named more precisely, i.e. led_module_get(). Or alike if this sounds not good either. -- With Best Regards, Andy Shevchenko