Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4873252pxu; Tue, 22 Dec 2020 03:03:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRYR/IYT2ETA7IYt775KmP7Q7NixwzSuH5a+T/C77aWWMpZ5oM8fWqJFFZY9q/Qc1ALUNT X-Received: by 2002:a17:906:38c3:: with SMTP id r3mr19251979ejd.193.1608634995770; Tue, 22 Dec 2020 03:03:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608634995; cv=none; d=google.com; s=arc-20160816; b=ciI4QcDteY11cqmbTuKSeaV8TzPJpDAyjq/3UQASFxUSHxNsdyMpOxQD/oZOcR1Gm1 5lLUr5AKQBm7etKrpIp7kigDpVZ5w6q0FiWzDl1vj+KtD8sQOasjS8oESEyyfCGFAgW+ ua6/64aeNdAlrkrs+w7yYvOg3w+fNF1gCfhCjmZYe6t6JaIpwTbPQa0/B1LUlCDd3u+I raZlaFbfG5SSO76hw06oaDHiv1RYsiC+bnFufeiWWSihgAzUFcQP4mFZCMy1H6V9K07+ m5jAMuJVQ9mgNl/rpiTXmJS9zMd49u15MjUTlgVG/7pE+cf0X995D6veu7jmY8cqQBZ4 Wv7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7xL1+xV/M7LvsjtW9KV2yCRgG/ihHMpqTb/fq0HOeZo=; b=aLP2UQJGI2uaRD0pGGO3OgaYA+SZF51Xp8moiIzArTvuBCxEip1qEJmpMn4dupbpOV W0PqJfEytz5uBs57ZMQvmRQbvSULcww6PW6gZI98vrA9I+21Pnz+PhZ69zJuGoJms6+w nCP+X4dhGjADHJr+SPbPNzLGWPYvVMMLwHkkfGYyUx28MtYj+1FZnPxTlXzOGpXEL17l lVNKelTQ9MplweQAQ5SanY5pNdqHxf7HSzrc0sw2DX3XSzFNZwmV3Lv3lNtkLoTA4fHB 1xS5g+cntZ3iCyr7MjrRvvmMGxQH3lWczz0b4CbWeM7Bwe8dyAEC7Hu1NC3RBCoDZiwj oKPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=KSpeNhkw; 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=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si12561111eda.139.2020.12.22.03.02.53; Tue, 22 Dec 2020 03:03:15 -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=@foss.st.com header.s=selector1 header.b=KSpeNhkw; 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=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbgLVK6v (ORCPT + 99 others); Tue, 22 Dec 2020 05:58:51 -0500 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:53971 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbgLVK6u (ORCPT ); Tue, 22 Dec 2020 05:58:50 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0BMAvYll004475; Tue, 22 Dec 2020 11:58:04 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=selector1; bh=7xL1+xV/M7LvsjtW9KV2yCRgG/ihHMpqTb/fq0HOeZo=; b=KSpeNhkwYIBUgu/AThq0j7BjHh7v59Q0zcWxja7oE4/WfqbsVOqC9KnCesZV3mFuUahC Zad+wclsps3yXRrp1piSxMrcaPKRnfxQowtCzKFP+C0cZZRoMUORItDlp9E0Utugq41t KhwKaKE9jd/g0Rs/1ZqKYIkNbx7HSP97p647vyRfdpdCwaXJ3Vz/b2wqXHKXOCNMCGdX HxlzwP6/8eM5BqEd2P4frURkGRQU4XdeHkxXklUwEZIsRRPZ9WpabJupYArNwUR+JDjV xQgZJ80RRzt3z+eP1IzphhH7yZxGw7pa6YxzAcRojvPDtbHHTBhxek9t1b0gzcIeiZ2V jA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 35k0d1bjtq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Dec 2020 11:58:04 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8B00D100038; Tue, 22 Dec 2020 11:58:04 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 743A920B86C; Tue, 22 Dec 2020 11:58:04 +0100 (CET) Received: from localhost (10.75.127.49) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 22 Dec 2020 11:58:03 +0100 From: Arnaud Pouliquen To: Bjorn Andersson , Ohad Ben-Cohen , Mathieu Poirier , Andy Gross CC: , , , , Subject: [PATCH v2 07/16] rpmsg: char: clean up rpmsg class Date: Tue, 22 Dec 2020 11:57:17 +0100 Message-ID: <20201222105726.16906-8-arnaud.pouliquen@foss.st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201222105726.16906-1-arnaud.pouliquen@foss.st.com> References: <20201222105726.16906-1-arnaud.pouliquen@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG4NODE3.st.com (10.75.127.12) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343,18.0.737 definitions=2020-12-22_04:2020-12-21,2020-12-22 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. This patch prepares the migration of the control device in rpmsg_ctrl. 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