Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14221407pxu; Mon, 4 Jan 2021 16:51:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyR+amJenMnXAiEfB9Da+RDGg4yGlM1z1e06CBqlwguZMb5k2Rt/58yZzZTszIz0RNdwdK7 X-Received: by 2002:a05:6402:1684:: with SMTP id a4mr73352208edv.348.1609807879501; Mon, 04 Jan 2021 16:51:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609807879; cv=none; d=google.com; s=arc-20160816; b=x1ywOs65Vafr37NgdR64fiU7KRQjfORva++oQdZojVquAsdAsx1939cg4FroeH7B2x MALmCjsQWZQc2aO0h/B3JqocXOKF8zKHVAmi1vVmfxFy+IV02hLCBTSjN9k12V3PpKd+ 9SpnpXdwtcUuNXZmQQi/OSvCs/lplptw6g5s4eHStVOvauVa7cFKy9fs/hqbaoe294gz Q9v9YTl4itZ1SgJqv8VgHgkVTKrPUw5RWhnMWiXVobj49wxbNYQ7eKg8abjrSPeImgJ1 bYFlq8Rt7QvR+cfp7nw4uLtFdN7HBYWWfT9KOQpDfk2OnsaRp7Ht504mt+uTeKr76FmT hnIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2xG9WgPgtXl4muZ5pfGY83Ze5M/V/IXRnJ0myAHjR2Y=; b=CHM+CMdv5CJDcKziXSMve1Qx/i4dzC2sUi75I/RtijJIIOIjFv+UdCiFClUWbS6WEe /mQQPR+28r6my4FP2rPniiLCjvjkwUpIMGhlMMaOye9Rr+ZLB26ld32VH68Rtad+EDb8 YHwfSz3bRFN5koaNsrZXEDuCNG4rQb/gPZOCrbRI2rLKjYt4HeirM1yjVqe3uXX9YgGb ppMDiA4DYKyANEk8UtELcZXVaZZ2mL5hT2ggkmtVCwo/avo0P25ohJV+NV2KS9WR4NGj BsG/MUG0lh+K5aY3NgJTU6Bun3i5x6/5qyHzxDZLikwTLSHMZeyy9jyV1IPyUqY6HO2x GmIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IuJPd0dA; 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 h17si30776207ejd.473.2021.01.04.16.50.56; Mon, 04 Jan 2021 16:51:19 -0800 (PST) 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=IuJPd0dA; 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 S1727098AbhAEAsk (ORCPT + 99 others); Mon, 4 Jan 2021 19:48:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbhAEAsj (ORCPT ); Mon, 4 Jan 2021 19:48:39 -0500 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A96CBC06179A for ; Mon, 4 Jan 2021 16:47:41 -0800 (PST) Received: by mail-ot1-x32e.google.com with SMTP id o11so27856724ote.4 for ; Mon, 04 Jan 2021 16:47:41 -0800 (PST) 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=2xG9WgPgtXl4muZ5pfGY83Ze5M/V/IXRnJ0myAHjR2Y=; b=IuJPd0dAkxTO1lWK4TF9V8AFKVnyUB+ihER0PjRAMXfARI3aPpAQzWGfgOBEY6io6u YxbCKcdrQ2g+xWRsWu9n40uE88TCcL92VESuO352htZsGo9AZTAaDIu5yV29L45OMCj+ sxRMvPXbsHPAYB3xQAZ3SBn+M77rLneFAkhwNjEj3f8i/eWstOK7oAZfeEQ3xH9fGe/P aZ1fFxTckvQnCbtJ9FHM7MuN+F8QPX0tVbalX7GPYgIwDulOFYiP2myazVy9h/2fchkx SIzwU+Bedf+8RTMon6xn1shsT02RCMPficHoHcW1JGeuZM/joj4wOmF1b3P2YIX7c1TX jn7Q== 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=2xG9WgPgtXl4muZ5pfGY83Ze5M/V/IXRnJ0myAHjR2Y=; b=gwg1xtWaAaNu2iuSI5eu8EmU2Puy4HP8xWlFVYDZ0RvjwCYnucNuGUQJSForG9Jk9g BsbROr1v7mSpwHAQoO75gEKiX4DtfT35wssO+QAa67HF7IAUBqLtsnPUHToR/Kj+bC5D ACVxy1FtNO/HoRl6ZDPsn7poFyTarrtGa3hNzX5f8UfASOOyDL6c/qHbqfecRvP4BagE CsDdZDlyxqxZ0KUXVGp4wKS4vVY89rSakIOIRQYpVkng3EEnyqMkxgVavC/67k1BuMnX cP8gitMZEc0kUojqAclQmHR3a7ggFjqCxEmcX5wMlQMYwdEA1yXirX31U1P29Oylt/fs nXwA== X-Gm-Message-State: AOAM530DJMwpiw6KOJxsDgPquKIUJxEjiAYbwIuVO2Omc2nS+jIDEg0x 9r49tB3IoD5yGr6tKUYo/ai4hQ== X-Received: by 2002:a05:6830:20d5:: with SMTP id z21mr53373201otq.310.1609807660949; Mon, 04 Jan 2021 16:47:40 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id u141sm13619181oie.46.2021.01.04.16.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 16:47:40 -0800 (PST) Date: Mon, 4 Jan 2021 18:47:38 -0600 From: Bjorn Andersson To: Arnaud Pouliquen Cc: Ohad Ben-Cohen , Mathieu Poirier , Andy Gross , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v2 07/16] rpmsg: char: clean up rpmsg class Message-ID: References: <20201222105726.16906-1-arnaud.pouliquen@foss.st.com> <20201222105726.16906-8-arnaud.pouliquen@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201222105726.16906-8-arnaud.pouliquen@foss.st.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 22 Dec 04:57 CST 2020, Arnaud Pouliquen wrote: This patch doesn't "clean up" the class, as described in $subject. It just removes it. > Suppress the management of the rpmsg class as attribute. It is already > handled in /sys/bus rpmsg as specified in > documentation/ABI/testing/sysfs-bus-rpmsg. Afaict it doesn't relate to /sys/bus/rpmsg, but rather what attributes should be associated with the rpmsg_device (and thereby present in its sysfs directory). But if these attributes are also added by the bus, then why do we have this code? If that's the case this seems like a nice cleanup that we should do outside/before merging the other patches. > This patch prepares the migration of the control device in rpmsg_ctrl. > It would be useful if the commit message described how it prepares for the migration and why. Regards, Bjorn > Signed-off-by: Arnaud Pouliquen > --- > drivers/rpmsg/rpmsg_char.c | 48 -------------------------------------- > 1 file changed, 48 deletions(-) > > diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c > index 4bbbacdbf3bb..732f5caf068a 100644 > --- a/drivers/rpmsg/rpmsg_char.c > +++ b/drivers/rpmsg/rpmsg_char.c > @@ -27,7 +27,6 @@ > #define RPMSG_DEV_MAX (MINORMASK + 1) > > static dev_t rpmsg_major; > -static struct class *rpmsg_class; > > static DEFINE_IDA(rpmsg_ctrl_ida); > static DEFINE_IDA(rpmsg_ept_ida); > @@ -291,41 +290,6 @@ static const struct file_operations rpmsg_eptdev_fops = { > .compat_ioctl = compat_ptr_ioctl, > }; > > -static ssize_t name_show(struct device *dev, struct device_attribute *attr, > - char *buf) > -{ > - struct rpmsg_eptdev *eptdev = dev_get_drvdata(dev); > - > - return sprintf(buf, "%s\n", eptdev->chinfo.name); > -} > -static DEVICE_ATTR_RO(name); > - > -static ssize_t src_show(struct device *dev, struct device_attribute *attr, > - char *buf) > -{ > - struct rpmsg_eptdev *eptdev = dev_get_drvdata(dev); > - > - return sprintf(buf, "%d\n", eptdev->chinfo.src); > -} > -static DEVICE_ATTR_RO(src); > - > -static ssize_t dst_show(struct device *dev, struct device_attribute *attr, > - char *buf) > -{ > - struct rpmsg_eptdev *eptdev = dev_get_drvdata(dev); > - > - return sprintf(buf, "%d\n", eptdev->chinfo.dst); > -} > -static DEVICE_ATTR_RO(dst); > - > -static struct attribute *rpmsg_eptdev_attrs[] = { > - &dev_attr_name.attr, > - &dev_attr_src.attr, > - &dev_attr_dst.attr, > - NULL > -}; > -ATTRIBUTE_GROUPS(rpmsg_eptdev); > - > static void rpmsg_eptdev_release_device(struct device *dev) > { > struct rpmsg_eptdev *eptdev = dev_to_eptdev(dev); > @@ -358,9 +322,7 @@ static int rpmsg_eptdev_create(struct rpmsg_ctrldev *ctrldev, > init_waitqueue_head(&eptdev->readq); > > device_initialize(dev); > - dev->class = rpmsg_class; > dev->parent = &ctrldev->dev; > - dev->groups = rpmsg_eptdev_groups; > dev_set_drvdata(dev, eptdev); > > cdev_init(&eptdev->cdev, &rpmsg_eptdev_fops); > @@ -477,7 +439,6 @@ static int rpmsg_chrdev_probe(struct rpmsg_device *rpdev) > dev = &ctrldev->dev; > device_initialize(dev); > dev->parent = &rpdev->dev; > - dev->class = rpmsg_class; > > cdev_init(&ctrldev->cdev, &rpmsg_ctrldev_fops); > ctrldev->cdev.owner = THIS_MODULE; > @@ -553,17 +514,9 @@ static int rpmsg_char_init(void) > return ret; > } > > - rpmsg_class = class_create(THIS_MODULE, "rpmsg"); > - if (IS_ERR(rpmsg_class)) { > - pr_err("failed to create rpmsg class\n"); > - unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); > - return PTR_ERR(rpmsg_class); > - } > - > ret = register_rpmsg_driver(&rpmsg_chrdev_driver); > if (ret < 0) { > pr_err("rpmsgchr: failed to register rpmsg driver\n"); > - class_destroy(rpmsg_class); > unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); > } > > @@ -574,7 +527,6 @@ postcore_initcall(rpmsg_char_init); > static void rpmsg_chrdev_exit(void) > { > unregister_rpmsg_driver(&rpmsg_chrdev_driver); > - class_destroy(rpmsg_class); > unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); > } > module_exit(rpmsg_chrdev_exit); > -- > 2.17.1 >