Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1737939ybh; Thu, 16 Jul 2020 22:52:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLB3EXosoZszTc9YunEsZvHkr6BglGSrPgCoMIrdm57L0qsbruj6sdNdIsqoXXH2PNBYax X-Received: by 2002:a50:d09c:: with SMTP id v28mr7771335edd.58.1594965128740; Thu, 16 Jul 2020 22:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594965128; cv=none; d=google.com; s=arc-20160816; b=tGYJi3ZY0q+l55w9J6cYcl5KNHqHj+aIcn5wb5n8L/xbLwcL9iSY++owRrzZjlsdFJ TQoS2xCt0CG9BX0UMYUcJcTvfZfbzVv1K+uheaBPYHdu4+XiHjmYyTRbYWavQfIp77e2 M00Zno3jvyTpbMV9UUChmFaVPcbBBkdaTM1E8EDBPb2awsikuIUf+LQwjrTukGVdyum+ ZvhtatknmbxEC0O0c7RLQdv2NxW+Z7zsz0od7Pp9BxMMxkKTFLEtzpVUaddkzcBv5W0Q aWiiSi9LAv1aV6Obv0DTsVV0T7SZZIYoLchXcdoq9C1SwbrJsNJFeFcj26qtqD8uvVvN t5xw== 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=1PFs+emTCjBmpzEcvwWiAu9ISkdboKsamgKoarfvfso=; b=BiomMkyYpdKcy31jYVQMx5fCsRqZaKEfhQ58MNsiBmZcr9aNXsn/c0NkEdUVv4vX1a glsyP+m6w5/3CQA8HCMySLMJowRJ6J0yBznBiQOx+fC1ZS2QMsexSoxZTetNew7lT/8/ qis8eA5OLZjwfzALd4u0gwUn8ui1A8DB14dneSVN2WEjiBtiXP+aUvUgtspoYO78hmD0 8CUZAA2E/cIlgOmkzPqrYc4oMgAaMgSy6pv4JD2YPbdWo72GfHoe4Q6r/pQ/coVMbGmd R1kzcSCmEUwKUafbn/dtLzHusWUgW7AhDV+jYrOQ82T7tFCF5tEWwEsu9oGBCpJFsm4x HCqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JxLXtCib; 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 bd16si4518098edb.20.2020.07.16.22.51.45; Thu, 16 Jul 2020 22:52:08 -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=JxLXtCib; 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 S1726250AbgGQFvH (ORCPT + 99 others); Fri, 17 Jul 2020 01:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbgGQFvF (ORCPT ); Fri, 17 Jul 2020 01:51:05 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABCF1C08C5DC for ; Thu, 16 Jul 2020 22:51:05 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id o13so6174484pgf.0 for ; Thu, 16 Jul 2020 22:51:05 -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=1PFs+emTCjBmpzEcvwWiAu9ISkdboKsamgKoarfvfso=; b=JxLXtCib/kxCaAeC1ZCQXAhXzOploS0tTxAWwsZf63bgYIK+5LqwpXU3j8CSOekg3e iCR3BCpMsCeq/XKL5vd2wM0XXAdpHPzwsCvMYvADBL3SYQrmVwNBJAViMncCUbbe6ek1 hvtAM4MQEPxvnV02mDJ2w4JQx7OT0cFqSIubN1O+2odmatkGQAFuUxVyXUX/1okipHku dxKHU9PUSX1xZbJd/1IevMDV8zkpfNR0diEep+/+cXAWY/ndIvJ3rRg7+c9SbGh1TT/g 4Zy14qehCwoAFillT5CkI1+ujy8KisWJ8HfOt2YO0k2r6RrFjIvpo3JUd/elfrwZfip/ Mlpg== 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=1PFs+emTCjBmpzEcvwWiAu9ISkdboKsamgKoarfvfso=; b=hrGa5TG01t5ccKX7G2InuqI++TVIILefQ6/6g4Gp0vKoqQANe6IKxu5+veGHHisOXd 5kNBpYLdGKn1HEckK+z6Xvz3xFNaqeEf5f2Mc6/ywkx7ak/q8ybxvuXF5Hvx3dO+ScRc 3fPRRkHa5WjAQmiCdp6lRPK02H8G67E6ey25ANwD9tAk+slBV7WvUe24zGdKcAZfPFo2 Tf+Fr3oai7lNPA8QTushU+ib1WWhxXOZ4Adbi6vg/NoiCdbwBy3pkidFCjJJ5+GV1/TJ vFNBJ0+a/N7l/8V5b5zZENE4f5vpL0Sdh7k/TF3skJ4UQqBkFRThya6LnY10RHGnVTNP /t7A== X-Gm-Message-State: AOAM530JeO/SAsV6E/xIGh7C7tJ4x76eC0x05p3nA7xLhlENDUopRxww 9KyQpLnRi7XtZ76bmYbWx28utQ== X-Received: by 2002:a63:a558:: with SMTP id r24mr7568200pgu.70.1594965064988; Thu, 16 Jul 2020 22:51:04 -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 b128sm6443836pfg.114.2020.07.16.22.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 22:51:04 -0700 (PDT) Date: Thu, 16 Jul 2020 22:49:02 -0700 From: Bjorn Andersson To: Siddharth Gupta Cc: agross@kernel.org, ohad@wizery.com, corbet@lwn.net, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, rishabhb@codeaurora.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v4 2/2] remoteproc: core: Register the character device interface Message-ID: <20200717054902.GJ2922385@builder.lan> References: <1594148870-27276-1-git-send-email-sidgup@codeaurora.org> <1594148870-27276-3-git-send-email-sidgup@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1594148870-27276-3-git-send-email-sidgup@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 07 Jul 12:07 PDT 2020, Siddharth Gupta wrote: > Add the character device during rproc_add. This would create > a character device node at /dev/remoteproc. Userspace > applications can interact with the remote processor using this > interface. > > Signed-off-by: Rishabh Bhatnagar > Signed-off-by: Siddharth Gupta > --- > drivers/remoteproc/remoteproc_core.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 0f95e02..ec7fb49 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -1966,6 +1966,13 @@ int rproc_add(struct rproc *rproc) > struct device *dev = &rproc->dev; > int ret; > > + /* add char device for this remoteproc */ > + ret = rproc_char_device_add(rproc); > + if (ret) { > + dev_err(dev, "Failed to add char dev for %s\n", rproc->name); Please move this error message into rproc_char_device_add(), to make it consistent with the other error handling in this function not printing. Apart from that it looks good. Regards, Bjorn > + return ret; > + } > + > ret = device_add(dev); > if (ret < 0) > return ret; > @@ -2241,6 +2248,7 @@ int rproc_del(struct rproc *rproc) > mutex_unlock(&rproc->lock); > > rproc_delete_debug_dir(rproc); > + rproc_char_device_remove(rproc); > > /* the rproc is downref'ed as soon as it's removed from the klist */ > mutex_lock(&rproc_list_mutex); > @@ -2409,6 +2417,7 @@ static int __init remoteproc_init(void) > { > rproc_init_sysfs(); > rproc_init_debugfs(); > + rproc_init_cdev(); > rproc_init_panic(); > > return 0; > @@ -2420,6 +2429,7 @@ static void __exit remoteproc_exit(void) > ida_destroy(&rproc_dev_index); > > rproc_exit_panic(); > + rproc_exit_cdev(); > rproc_exit_debugfs(); > rproc_exit_sysfs(); > } > -- > Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >