Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833AbbETWJs (ORCPT ); Wed, 20 May 2015 18:09:48 -0400 Received: from mail-bn1bon0139.outbound.protection.outlook.com ([157.56.111.139]:63619 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753636AbbETWJe (ORCPT ); Wed, 20 May 2015 18:09:34 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; arm.com; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NOO5JP-08-AMK-02 X-M-MSG: From: Suravee Suthikulpanit To: , , , , , , , CC: , , , , , , , , , , , "Suravee Suthikulpanit" Subject: [V5 PATCH 5/5] amd-xgbe: Unify coherency checking logic with device_dma_is_coherent() Date: Wed, 20 May 2015 17:09:18 -0500 Message-ID: <1432159758-4486-6-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1432159758-4486-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1432159758-4486-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD035;1:SF506C1HIiKGxIOFqPuArw+wR5bqqEwWWxWNwMo4llhg8mjLl22iZ4vShUCYj1SypLUpu38K9EToXGXwY62Ru51sY+KGHjsaN8/izgnQZ92JHZqOEeAeuJjesMooJ+O1EuL/0Ky/i61nigmc7ih5SEB7iTHmaJBwR1UbuyLvS8Tnmmr7udJvVK4ARylrn9vYnpXpv5QDmDozf47f5EFKVZokPMFfvSgSRXr7rB5coxyFezroZXdw8H2MzFz/W4sxWvrAn/HU4oolg/RBrK+tvULBtJB7Ulh9gW47bCKigLuFC06cTcVksPGEHFjv5AAU X-Forefront-Antispam-Report: CIP:165.204.84.222;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(189002)(199003)(50466002)(5001830100001)(64706001)(5001860100001)(101416001)(50226001)(87936001)(47776003)(76176999)(50986999)(86362001)(5001770100001)(189998001)(2201001)(106466001)(229853001)(53416004)(2950100001)(4001540100001)(48376002)(105586002)(46102003)(62966003)(77156002)(68736005)(97736004)(19580395003)(77096005)(92566002)(19580405001)(36756003)(309714004);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR02MB067;H:atltwp02.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB067;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB391; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BLUPR02MB067;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB067; X-Forefront-PRVS: 0582641F53 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2015 22:09:28.8222 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.222];Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR02MB067 X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2460 Lines: 79 Currently, amd-xgbe driver has separate logic to determine device coherency for DT vs. ACPI. This patch simplifies the code with a call to device_dma_is_coherent(). Signed-off-by: Tom Lendacky Signed-off-by: Suravee Suthikulpanit --- drivers/net/ethernet/amd/xgbe/xgbe-main.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c index 7149053..6d2c702 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c @@ -168,13 +168,8 @@ static void xgbe_init_all_fptrs(struct xgbe_prv_data *pdata) #ifdef CONFIG_ACPI static int xgbe_acpi_support(struct xgbe_prv_data *pdata) { - struct acpi_device *adev = pdata->adev; struct device *dev = pdata->dev; u32 property; - acpi_handle handle; - acpi_status status; - unsigned long long data; - int cca; int ret; /* Obtain the system clock setting */ @@ -195,24 +190,6 @@ static int xgbe_acpi_support(struct xgbe_prv_data *pdata) } pdata->ptpclk_rate = property; - /* Retrieve the device cache coherency value */ - handle = adev->handle; - do { - status = acpi_evaluate_integer(handle, "_CCA", NULL, &data); - if (!ACPI_FAILURE(status)) { - cca = data; - break; - } - - status = acpi_get_parent(handle, &handle); - } while (!ACPI_FAILURE(status)); - - if (ACPI_FAILURE(status)) { - dev_err(dev, "error obtaining acpi coherency value\n"); - return -EINVAL; - } - pdata->coherent = !!cca; - return 0; } #else /* CONFIG_ACPI */ @@ -243,9 +220,6 @@ static int xgbe_of_support(struct xgbe_prv_data *pdata) } pdata->ptpclk_rate = clk_get_rate(pdata->ptpclk); - /* Retrieve the device cache coherency value */ - pdata->coherent = of_dma_is_coherent(dev->of_node); - return 0; } #else /* CONFIG_OF */ @@ -364,6 +338,7 @@ static int xgbe_probe(struct platform_device *pdev) goto err_io; /* Set the DMA coherency values */ + pdata->coherent = device_dma_is_coherent(pdata->dev); if (pdata->coherent) { pdata->axdomain = XGBE_DMA_OS_AXDOMAIN; pdata->arcache = XGBE_DMA_OS_ARCACHE; -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/