Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2118574pxa; Mon, 17 Aug 2020 00:54:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzatbPoGhVMzMQ0j7HRaw5AGIq43abuJLbBEAZ6TQz+TcqgIx/Uuu0+x33QGSOma1mORo+z X-Received: by 2002:aa7:c50b:: with SMTP id o11mr13302580edq.59.1597650862371; Mon, 17 Aug 2020 00:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597650862; cv=none; d=google.com; s=arc-20160816; b=B3W6qADhecZNFOnaV6z8k/blhb1X0EEKLSChD4ab7ZCTeBMG3rCNECzTEK32H8zr9E 95izaH7wsKKNcYWrw194UKvp8QYIdy7R7gw8iGBKplBeEOmyEVf4R5jBUOzIy5TjY+dq 7AGCxa9lw1yxRcBaC1s6GN8n6neBRFGW7D5Lm0sF0mimNOwXWnT+KvyMHgyNDg2T/OyN HXMW9eApHK3D5vw83iB+MFXhe9QZ9++Kzcm6sxsrdQtxv0sKU2esUVLbQefW/JDg4Bp9 4U6VT3k1E0n5fgBtp15l7ewCjCFgc4qtNIGCH8EeRCd0qhBS+fY6l2TclY7Md44zBTZJ 5gxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TvPb+JvPlM2gLupfxpvahIiyjSj9kZ8mIzXjHj3yj5Q=; b=j8XNmi5PHuqZ5Y1SP5yNezXBUXmsuDAirp8+En3nznvth33hNNDhJMv/gXml1Jo8MX o1h3Ev6x7NsQr9+8gNwKa6eBA3T9sEgdYfK9xgxU0VnnmmYeOor8FHaaFI0JDSz77EV9 f7+HoBxKxS8Lzsq/Mz1w2LzHtfiSeljftgh9EkUz93tcWOqgvtGVGY+dLXOwHjUwbPwz nJxtKq39Z46sbnNdhqGRfOPovpUWwGQYBau/SZn/iLvz898W/phYBw5/Ed7ZAxCAT9Kj HASF2uarNwYxB0tMjqFnR7aHn75MRPuOKkgPv8hCMw5THiFzx8XHgrhO4TAPOYMVSaOG B/gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yczP2SXE; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t26si10599053ejb.695.2020.08.17.00.53.59; Mon, 17 Aug 2020 00:54:22 -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=@kernel.org header.s=default header.b=yczP2SXE; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727824AbgHQHvJ (ORCPT + 99 others); Mon, 17 Aug 2020 03:51:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:45502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbgHQHuW (ORCPT ); Mon, 17 Aug 2020 03:50:22 -0400 Received: from mail.kernel.org (ip5f5ad5a3.dynamic.kabel-deutschland.de [95.90.213.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 280032224D; Mon, 17 Aug 2020 07:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597650620; bh=fmYTNRmOukXTEcCF9oMdnQKxhH25ltseKK1ahgmXuZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yczP2SXEQ3j5hP+o97vBgh4a7KoBpsg/cAn38KbJElcEehR69+q6rCSvNzIv952QZ VeLpi3Qv+LDAtlgnnyFKLsannxxsFGSmdhWVGxF7HAAckXcXtu9rhoqul0tj/7rmNs pv4MEJsOc9upJD5shKL3L0glYjDFwBcpqwjGbRzs= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1k7ZuM-00BfcJ-9y; Mon, 17 Aug 2020 09:50:18 +0200 From: Mauro Carvalho Chehab To: Greg Kroah-Hartman Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , John Stultz , Manivannan Sadhasivam , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 10/16] iommu: hisi_smmu_lpae: convert it to probe_device Date: Mon, 17 Aug 2020 09:50:09 +0200 Message-Id: <4e0e8de1f472590b5ee3a45a79cd1c8948aa0479.1597650455.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The add_device()/remove_device() was removed on Kernel 5.8. Convert the driver to use probe_device/release_device. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hisi_smmu_lpae.c | 31 +++++------------------ 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/drivers/staging/hikey9xx/hisi_smmu_lpae.c b/drivers/staging/hikey9xx/hisi_smmu_lpae.c index 1fe57c10e745..c8c7e8e3dde2 100644 --- a/drivers/staging/hikey9xx/hisi_smmu_lpae.c +++ b/drivers/staging/hikey9xx/hisi_smmu_lpae.c @@ -529,33 +529,14 @@ static bool hisi_smmu_capable(enum iommu_cap cap) return false; } -static int hisi_smmu_add_device(struct device *dev) +static struct iommu_device *hisi_smmu_probe_device(struct device *dev) { - struct hisi_smmu_device_lpae *iommu = hisi_smmu_dev; - struct iommu_group *group; - - if (iommu) - iommu_device_link(&iommu->iommu, dev); - else - return -ENODEV; - - group = iommu_group_get_for_dev(dev); - if (IS_ERR(group)) - return PTR_ERR(group); - - iommu_group_put(group); - - return 0; + return &hisi_smmu_dev->iommu; } -static void hisi_smmu_remove_device(struct device *dev) +static void hisi_smmu_release_device(struct device *dev) { - struct hisi_smmu_device_lpae *iommu = hisi_smmu_dev; - - if (iommu) - iommu_device_unlink(&iommu->iommu, dev); - - iommu_group_remove_device(dev); + /* As just one SMMU is possible, nothing to do here */ } static struct iommu_ops hisi_smmu_ops = { @@ -567,8 +548,8 @@ static struct iommu_ops hisi_smmu_ops = { .map = hisi_smmu_map_lpae, .unmap = hisi_smmu_unmap_lpae, .iova_to_phys = hisi_smmu_iova_to_phys_lpae, - .add_device = hisi_smmu_add_device, - .remove_device = hisi_smmu_remove_device, + .probe_device = hisi_smmu_probe_device, + .release_device = hisi_smmu_release_device, .device_group = generic_device_group, .pgsize_bitmap = SMMU_PAGE_SIZE, }; -- 2.26.2