From patchwork Mon Aug 21 05:53:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 9911623 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 59719602D8 for ; Mon, 21 Aug 2017 05:56:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BBB3286E4 for ; Mon, 21 Aug 2017 05:56:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4040D2871E; Mon, 21 Aug 2017 05:56:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84FE6286E4 for ; Mon, 21 Aug 2017 05:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751058AbdHUF43 (ORCPT ); Mon, 21 Aug 2017 01:56:29 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:38629 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbdHUF42 (ORCPT ); Mon, 21 Aug 2017 01:56:28 -0400 Received: by mail-pg0-f68.google.com with SMTP id t3so1871661pgt.5; Sun, 20 Aug 2017 22:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:subject; bh=p+8J4vgoDrV1jbNTS4eazhEkwrMvSrkANgB2gp1MM+k=; b=mRFHcfJPnuw0DFOIEqOScpWzqw5ZxI7fo8b7ZUvVTPM+vZDRFoQBddO1qKdzD9MulO NR0Xj6qgrCg5C6MD+Sab1tVJ96kyNzgaZtLC1w1pu3hfpxODWxymuXe3V/onb7skcSWi IoQzM9yPApKb9gDqFsp38SiKe3JyDQYKRa+Ua1wPUP2khk17upOVfEynijucJDmC/7cC 84vLidcPOEcJFcRmtVoN91p8EyiM1iDVgppPJxF/EpTyoHBKBT7di1bUihEOhRBinFh1 E68am8I9TDt4qUVhgey+7/7CRzPYZ+D8T91Vc5lcETA5M28BhmqZejt8mPuqCophSWGV 2kCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:date:message-id:subject; bh=p+8J4vgoDrV1jbNTS4eazhEkwrMvSrkANgB2gp1MM+k=; b=oVhZgz4s8qkJTJItmTB4Y/9w+VX9okMST/uicl2xZk8J6EH76nHWq9BgLXPDIQVSVc SHaYuPZMqZuZzGDyEHHnOHJWRLthgK+7Osv1qY/nn4UcEuSGgbtAFoDN7W8H/mzRpvtp pR1VdwlJHeUSkEjzp2XLXdgkdKRwiviSlzxpqUOnhfr2eoc6KupQHvXvUIzBJNShEVBC ViB2SYq7DDyClY0k8OkXBcahnI5Nf1LlTnvbUzgJG3uH/vr/NpvCf9BZg1fVWnuATw6a fOVTlLdj/F6aUb188DNYPlpdy3+Z9CM1wa3ti5nLtC6DTw1F+6nJLceN9IbgHZCOkL51 Y5mA== X-Gm-Message-State: AHYfb5jmsKsRuvzALE7X0Z4n9a3+s/LIAKVBW6BL8ETAWKso7Dlm3k+Y +/rHpZVxwauojQ== X-Received: by 10.84.232.207 with SMTP id x15mr11020983plm.162.1503294987737; Sun, 20 Aug 2017 22:56:27 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id v9sm24338912pgo.39.2017.08.20.22.56.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Aug 2017 22:56:26 -0700 (PDT) From: Magnus Damm To: joro@8bytes.org Cc: laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be, sricharan@codeaurora.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, iommu@lists.linux-foundation.org, horms+renesas@verge.net.au, Magnus Damm , robin.murphy@arm.com, m.szyprowski@samsung.com Date: Mon, 21 Aug 2017 14:53:35 +0900 Message-Id: <150329481531.31395.6238405988822544474.sendpatchset@little-apple> Subject: [PATCH] iommu/ipmmu-vmsa: Use iommu_device_sysfs_add()/remove() Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Extend the driver to make use of iommu_device_sysfs_add()/remove() functions to hook up initial sysfs support. Suggested-by: Joerg Roedel Signed-off-by: Magnus Damm --- Applies on top of next-20170817 drivers/iommu/ipmmu-vmsa.c | 6 ++++++ 1 file changed, 6 insertions(+) --- 0001/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c 2017-08-21 14:40:13.940607110 +0900 @@ -953,6 +953,11 @@ static int ipmmu_probe(struct platform_d ipmmu_device_reset(mmu); + ret = iommu_device_sysfs_add(&mmu->iommu, &pdev->dev, NULL, + dev_name(&pdev->dev)); + if (ret) + return ret; + iommu_device_set_ops(&mmu->iommu, &ipmmu_ops); iommu_device_set_fwnode(&mmu->iommu, &pdev->dev.of_node->fwnode); @@ -975,6 +980,7 @@ static int ipmmu_remove(struct platform_ { struct ipmmu_vmsa_device *mmu = platform_get_drvdata(pdev); + iommu_device_sysfs_remove(&mmu->iommu); iommu_device_unregister(&mmu->iommu); #if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)