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 E175FCD1284 for ; Tue, 2 Apr 2024 13:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To: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=jD1G9GtuHh9FFaj7b8F1mWDZMaMfipfbkgZzZrQbOwg=; b=T/r8UqZyk7IEAv 7an3FRJo6mwGDFZhyvc3C0sd2a3fewKItQaLfW3q1cv1WLfKZ5leHqkjCLCEOYDMGqMH2IP4UMNqH /tnPZSaDBHI8T51UH4IBVnJ3PBbR1Umzbel30BuP7PZ4rAsKfGeNcov4qGQs/2pPCQH0xhT4JGjx/ OwQQ2yeHUO1LLxY6/pesHOjfiI6/60tfibsFojpKxBHnSeo1sakV/F9722p6AxaTp8puZhV4aCPYW Nhuk11E+hTmLebvx64wPUQ0VvLjdlIV788QnZWTiiWj0COLS+JOwH5t32O/5YJlTEfu9bHWuM6lWl E/8YII1495pDcC4ghPKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rre6J-0000000BLSD-419y; Tue, 02 Apr 2024 13:22:55 +0000 Received: from mgamail.intel.com ([192.198.163.9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rre6G-0000000BLRA-2M1K for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2024 13:22:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712064173; x=1743600173; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=5B4VAqRtah3hwR9aUAuF7xCrOB8pdBZXUCtToZA8hZ4=; b=kG6vC4hxcKz0LZjhKa1X31X/fhur5kpBoGxshV+8ElZ9DpvJitFKcME+ WTbebnhvzwBiKHv8SJr43ES5XYYPLhPLwY4pI5qOvUMDxoi0hAcGYkfmy GYuwIUQvycTlwSV9oR/nm9MKQhmC3lWKZON7nrazp+RDQwK0a6MP7fz+6 /8euDZKHPWLMrXva5x75d86M+CzQKSVbOzqCjliZWm1EhrXGWFkC9cszz 6OApT44GJe/CHklpc6pJj6K5HaIZTBdvleYZVGd0bcbJRncZs7T5y6qau MYz1N3Jbq3XnctrSnU1tZeR7soef7npDZsw2KQjTEEuwTkCWYjFt9YLSO w==; X-CSE-ConnectionGUID: z9qzVs9NSYiDaF4ddb0KEQ== X-CSE-MsgGUID: sGUyW2OKSTCW/cKEK9BDyA== X-IronPort-AV: E=McAfee;i="6600,9927,11031"; a="17960342" X-IronPort-AV: E=Sophos;i="6.07,175,1708416000"; d="scan'208";a="17960342" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2024 06:22:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11031"; a="915140889" X-IronPort-AV: E=Sophos;i="6.07,175,1708416000"; d="scan'208";a="915140889" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2024 06:22:48 -0700 Received: from andy by smile with local (Exim 4.97) (envelope-from ) id 1rre6A-00000000oj8-0Wz8; Tue, 02 Apr 2024 16:22:46 +0300 Date: Tue, 2 Apr 2024 16:22:45 +0300 From: Andy Shevchenko To: "Peng Fan (OSS)" Cc: Sudeep Holla , Cristian Marussi , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Dan Carpenter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, Peng Fan , Oleksii Moisieiev Subject: Re: [PATCH v7 4/4] pinctrl: Implementation of the generic scmi-pinctrl driver Message-ID: References: <20240402-pinctrl-scmi-v7-0-3ea519d12cf7@nxp.com> <20240402-pinctrl-scmi-v7-4-3ea519d12cf7@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240402-pinctrl-scmi-v7-4-3ea519d12cf7@nxp.com> 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-20240402_062252_776700_10DF7391 X-CRM114-Status: GOOD ( 19.52 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Apr 02, 2024 at 10:22:24AM +0800, Peng Fan (OSS) wrote: > From: Peng Fan > > scmi-pinctrl driver implements pinctrl driver interface and using > SCMI protocol to redirect messages from pinctrl subsystem SDK to > SCMI platform firmware, which does the changes in HW. ... > +#include > +#include > +#include > +#include > +#include > +#include Missing headers. ... > + *p_groups = (const char * const *)func->groups; Is this casting needed? ... > +static int pinctrl_scmi_pinconf_get(struct pinctrl_dev *pctldev, > + unsigned int _pin, unsigned long *config) Why underscored parameter name? ... > +static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, > + struct pinctrl_desc *desc) > +{ > + struct pinctrl_pin_desc *pins; > + unsigned int npins; > + int ret, i; > + > + npins = pinctrl_ops->count_get(pmx->ph, PIN_TYPE); > + /* > + * npins will never be zero, the scmi pinctrl driver has bailed out > + * if npins is zero. > + */ This is fragile, but at least it is documented. > + pins = devm_kmalloc_array(pmx->dev, npins, sizeof(*pins), GFP_KERNEL); > + if (!pins) > + return -ENOMEM; > + > + for (i = 0; i < npins; i++) { > + pins[i].number = i; > + ret = pinctrl_ops->name_get(pmx->ph, i, PIN_TYPE, &pins[i].name); > + if (ret) How does the cleanup work for the previously assigned pin names? Is it needed? Maybe a comment? > + return dev_err_probe(pmx->dev, ret, > + "Can't get name for pin %d", i); > + } > + > + desc->npins = npins; > + desc->pins = pins; > + dev_dbg(pmx->dev, "got pins %u", npins); > + > + return 0; > +} ... > +static const struct scmi_device_id scmi_id_table[] = { > + { SCMI_PROTOCOL_PINCTRL, "pinctrl" }, > + { } > +}; > +MODULE_DEVICE_TABLE(scmi, scmi_id_table); Move this closer to the user. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel