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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DD01C433E0 for ; Thu, 21 May 2020 18:45:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3B7B620738 for ; Thu, 21 May 2020 18:45:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BYD1L/yX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="r+AZJRu3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B7B620738 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=URR1dRTCrXNCQACVLFv6KIqZnbnBik+NgElfUDvKKc4=; b=BYD1L/yXuN0M15 BFX0N9F08KLdGok7wVvy/LWBlYm0YHr31ypgGm412lyKBxxkaDpbwMefID9pzODdkEUdImHxPa9Xw 8X1ItZrvNNlYj3OC79NICBqOdOJKza+Z4iMSiP7dMzBhfVSKvjUyaJlPE4XGHw2lzTxoHq/YJS0jK SbK0ZPwiHp6Rup/u8iV8UWv+FxIhfE0UTjK3ycBic2z83YzXxhPdDJYcacPk0dT37hv4Znk8sarGB diE9HPrytZQfC6P4ipOE6e+Ei5vdImWedkGkJJoxA+hxTruwh2BADnCuNd54nofu6Xif4tPDDJPsq K9Ly/dTBM6ML6RSzkE8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbqCU-0007nv-De; Thu, 21 May 2020 18:45:50 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbqCR-0007n1-OH for linux-arm-kernel@lists.infradead.org; Thu, 21 May 2020 18:45:49 +0000 Received: by mail-pg1-x544.google.com with SMTP id n11so3598208pgl.9 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=kBFvXIoyx5JR/DQ0XnZLd0v+FhS59zjog2tXl4bMqG6LwT7O/9UrL9gMtnzVoDX0JN rLRr69ZCyglirL8hiza7b0i3bDASD/7GDQ0kF4HM96vdf0ihMrxpNqIZKqI3YdeqUmqe l+YbQY4sNMY2e5k7Ylv8kHpyUAX9bfUkH8DvCmCirsypeq6Bpkw9qg4AcjwYvv7u1yfo VNGt+9T2EhvgMpOCDvKk1nmmiGxd2yUWAS3GJwskTI1jpcPqdljbi8z4ebPGlz2YzeuC DHdU4Cgyv46pW0P4B6SFoDixNvA9LCutH6BJkO5t6nSgShOrEumd59N58BZMSDEdLAof dS8Q== X-Gm-Message-State: AOAM531ZJEuxJeb5ulugDene+ZCEGKqoPZb6/kiNJjmQzrx2is6fPUGx YJNzjDowQliMEUzi3vJlUwy+Ug== X-Google-Smtp-Source: ABdhPJzvAmH8U4KBIxMOLHqgBdJx23hqsA0xjqegq5rGHfJS7mrUJhHAnx3Fwau8/vsc2QlNDUyUqA== 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 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-Disposition: inline In-Reply-To: <20200521001006.2725-2-s-anna@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200521_114547_825755_C0320A50 X-CRM114-Status: GOOD ( 19.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Mathieu Poirier , Lokesh Vutla , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel