Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1649635ybk; Thu, 21 May 2020 11:48:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVaF4JaWD92wvUuA19BAkVTydjlYZqRwwfEciByNt3Jjhlpx8whemey2x5rR3UYMcrBZdB X-Received: by 2002:a17:906:5310:: with SMTP id h16mr4845935ejo.400.1590086887532; Thu, 21 May 2020 11:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590086887; cv=none; d=google.com; s=arc-20160816; b=xol4RBPdDJYXNh5SHujJhmmbyvMonZy9F7VBEKlGM9Ujx57NLPvUhARXRklAp9smCn dSwnGTH+Z0qWhv/rcOO0tnlBSxRA3QP/P/9CYBwM1y+RK4F//nJ013WlyT4A9J7ZmFW7 UMU86CEgXaxdicPlBH9rvzY2k47krs8hDuQ0ihth0eVAye5gAnLFK55EVW8Aw/u0Hg1a Cc902ecj2WycSkOkCl9m7U4zLXONyTMHiOxNL4HJcA8CidCfIUWLuy9W9DkxYp3AMxNw vFLMXQ58a1enaQPrv6g6ROIw9pPRLfd3MlwIfH4KsPyfmPDfzGmCyzz+rwQ347WcgRfU s/fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gU8sgFKhNViTucmSrL8PoKpJXA/y6HhdPP2rA9oeoRs=; b=XLu+xgR6+LTxF86ucAbJBFMhzz5uwrz113nmMCf3QdGCWpCcKXP+9JqWC9jIeUJWRL GkjPgn2eWALS9T2/r027xSsoaQR6DTnGX1TSeCjYLAAsWhAw/Nkk5ndXVSf73kcG4a+B tdeCFgPFM1r2XDqhOtKm7fWuo/SBD0qxRaeK21tVMEuZdl2GZWN5v0wSc2TzdrJyJTqY e+OUCkaIvCpbxGzvPN2na/+quUhVOTAnzj/u8xydfphEUGlPFBdOQ5l3BStnzHVWQN4E 5byA4DekaPY88Wz4WYNO8Hm164jXgMFvNZoMD7k2ECfQSrZId71WqwDHlfNzBqzEEnfx 57Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r+AZJRu3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oy3si3968563ejb.226.2020.05.21.11.47.44; Thu, 21 May 2020 11:48:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r+AZJRu3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729736AbgEUSpq (ORCPT + 99 others); Thu, 21 May 2020 14:45:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728988AbgEUSpq (ORCPT ); Thu, 21 May 2020 14:45:46 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B451C061A0E for ; Thu, 21 May 2020 11:45:46 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id u5so3610203pgn.5 for ; Thu, 21 May 2020 11:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gU8sgFKhNViTucmSrL8PoKpJXA/y6HhdPP2rA9oeoRs=; b=r+AZJRu3w6JTsxL9KO6nU41GHlIcNCImEJya4BVj3jLk1yS6icM9SUIyDHKfgcai5Y /m2RAVPAZY6ES+8b+7Txyszh0a5kRmAFSFdKGdxndopgAYEcD4oRHsiSi+Y4A/pEiNmP 2IQ37IjlC+vsSb21XAzgX+yhOfGJAdqIr8N8TYrTDNbat7nE02ikplbIYQnu/UcpsmxJ BGaIaXtYi3NU26GiUvFrTkHyUB9FArAxhYFKITKQjLeO9UheJwGcxnjK1i+oUNPDj2Ve 1vg9w3AIfdncH6IlikagLtM+LH3gOHN5QPcjXemjceYNp6LK3TsREjcexk7UagXHd5oN ceCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gU8sgFKhNViTucmSrL8PoKpJXA/y6HhdPP2rA9oeoRs=; b=O8fU2rfRPfChhpwZ3yfiJozzoAbMS7renyu00IHDNKKJMKSJAyQg3hJOFge6881RoN EGQcr9AZAjngFgMYUVkVoAIAm+BmLTIz/U+kgKRHVbo64D73bXj7jI1MfFoCZxhKzzbM m5v02bkgf50DFaZ9EvOVmz7B1YokWALCroyK0kbQOm1Id7TLF3pZbGssVXuXMh5LRICo hwMEhbDW2PxrhmMCL4oX4mpKx7736rVd2Cr6SZQch4wfXLceclmTXrAl5RJAyIhKcgq0 lBb9mfR1p0+Ur10ngXaJLnMqRrxnIMxZQBnYBgJkD5djnCxVxZxiWbQvKSzqE9JHU0t+ Qdkw== X-Gm-Message-State: AOAM532+BiCQyWz8QATdE453jqEdP1BhFP/2gWiq564IWBGBRbRb6PvW pkzfTrivayO34bEC4DGaqNtUjQ== X-Received: by 2002:a62:e707:: with SMTP id s7mr111797pfh.208.1590086745675; Thu, 21 May 2020 11:45:45 -0700 (PDT) Received: from builder.lan (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id m43sm5106636pje.16.2020.05.21.11.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 11:45:45 -0700 (PDT) Date: Thu, 21 May 2020 11:44:27 -0700 From: Bjorn Andersson To: Suman Anna Cc: Rob Herring , Mathieu Poirier , Lokesh Vutla , linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/4] remoteproc: Introduce rproc_of_parse_firmware() helper Message-ID: <20200521184427.GL408178@builder.lan> References: <20200521001006.2725-1-s-anna@ti.com> <20200521001006.2725-2-s-anna@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521001006.2725-2-s-anna@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 20 May 17:10 PDT 2020, Suman Anna wrote: > Add a new helper function rproc_of_parse_firmware() to the remoteproc > core that can be used by various remoteproc drivers to look up the > the "firmware-name" property from a rproc device node. This property > is already being used by multiple drivers, so this helper can avoid > repeating equivalent code in remoteproc drivers. > > Signed-off-by: Suman Anna Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > v2: New patch > > drivers/remoteproc/remoteproc_core.c | 23 +++++++++++++++++++++++ > drivers/remoteproc/remoteproc_internal.h | 2 ++ > 2 files changed, 25 insertions(+) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 9f04c30c4aaf..c458b218d524 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -1034,6 +1034,29 @@ rproc_of_resm_mem_entry_init(struct device *dev, u32 of_resm_idx, size_t len, > } > EXPORT_SYMBOL(rproc_of_resm_mem_entry_init); > > +/** > + * rproc_of_parse_firmware() - parse and return the firmware-name > + * @dev: pointer on device struct representing a rproc > + * @index: index to use for the firmware-name retrieval > + * @fw_name: pointer to a character string, in which the firmware > + * name is returned on success and unmodified otherwise. > + * > + * This is an OF helper function that parses a device's DT node for > + * the "firmware-name" property and returns the firmware name pointer > + * in @fw_name on success. > + * > + * Return: 0 on success, or an appropriate failure. > + */ > +int rproc_of_parse_firmware(struct device *dev, int index, const char **fw_name) > +{ > + int ret; > + > + ret = of_property_read_string_index(dev->of_node, "firmware-name", > + index, fw_name); > + return ret ? ret : 0; > +} > +EXPORT_SYMBOL(rproc_of_parse_firmware); > + > /* > * A lookup table for resource handlers. The indices are defined in > * enum fw_resource_type. > diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h > index 4ba7cb59d3e8..e5341e91d2fc 100644 > --- a/drivers/remoteproc/remoteproc_internal.h > +++ b/drivers/remoteproc/remoteproc_internal.h > @@ -28,6 +28,8 @@ struct rproc_debug_trace { > void rproc_release(struct kref *kref); > irqreturn_t rproc_vq_interrupt(struct rproc *rproc, int vq_id); > void rproc_vdev_release(struct kref *ref); > +int rproc_of_parse_firmware(struct device *dev, int index, > + const char **fw_name); > > /* from remoteproc_virtio.c */ > int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id); > -- > 2.26.0 >