From patchwork Fri Nov 17 13:38:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Tudor X-Patchwork-Id: 10062793 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 7858E6023A for ; Fri, 17 Nov 2017 13:55:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68CF22ABA0 for ; Fri, 17 Nov 2017 13:55:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DAC02AC06; Fri, 17 Nov 2017 13:55:01 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 612112ABC1 for ; Fri, 17 Nov 2017 13:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2wo1kn6XU04g/2JVd/l7eoOatJ6ocsGRveqD0HDdPLU=; b=Ydki9QLfH6D6me i8n+7teOTNPWcYYJuumq+gr6DpQ9HcIzSNxCJqxrZKY11rFCsaontHhvyHOm92lQmUOala9ALE/1Q SK1przdATAr6LkpdFeWYruLv262sCT+NUbm/IvKsk8464VvIOskIV4WAPeSajEyr1GfL+iguIKizV 6oEJ9IOG5o12rkx21acY1wTDaPHK1ZgXaqnQtAQrAoLILllmMdCzvA0m3V3akS6SBFc6/vfRMATEZ xV43Ie1FrobxM83RvLQTsnGGTo0Rz7EkgNBw4uQb7oIDiLDGlkrXF+QcnP0cRX0s2KdaF5E8PsWl6 1J6j02bFb8AP8AMWhvIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eFh6Z-0001Oe-UK; Fri, 17 Nov 2017 13:54:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFh6H-00014c-8k for linux-arm-kernel@bombadil.infradead.org; Fri, 17 Nov 2017 13:54:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hToLhie6jd6ABg/96eCcYvNPobKjA5bUw4/tkhEZIxo=; b=dJX0PWLDW+tzqIAsZnbEGoNi9 o0NbdmTbUJoMUTMHXwDo7VxktaBaFGUCzLvLiHZ/yWtt8lppJkGtOA7MOAaCKAKv60aUnmwmeFiyE E6H1ZPI/GGHMvug+1x4FMR4zH4iQANAoCkLITgp0qmTS00AUdjHmxm5J4AZwBK33gtcxZBxirU+vQ zeu/b6ryj6LYI7X6gxXoFS2LCglbMyAyaY53cQIvFl69DRC09pRa62spMb5JadlbfOxcBxFpgnyZy V+P0cT5J/FhXTDuPpDvXRdX7RpFIUDGsWjQwdOSj2PWPWdpSnISKYUW/LlczSBDB3UagvsUVt1uza BUAbPIeLw==; Received: from mail-cys01nam02on0088.outbound.protection.outlook.com ([104.47.37.88] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFgrw-0003hj-0f for linux-arm-kernel@lists.infradead.org; Fri, 17 Nov 2017 13:39:46 +0000 Received: from CY4PR03CA0019.namprd03.prod.outlook.com (2603:10b6:903:33::29) by SN2PR03MB2365.namprd03.prod.outlook.com (2603:10b6:804:e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Fri, 17 Nov 2017 13:39:10 +0000 Received: from BN1AFFO11FD043.protection.gbl (2a01:111:f400:7c10::148) by CY4PR03CA0019.outlook.office365.com (2603:10b6:903:33::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.239.5 via Frontend Transport; Fri, 17 Nov 2017 13:39:10 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD043.mail.protection.outlook.com (10.58.52.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.218.12 via Frontend Transport; Fri, 17 Nov 2017 13:39:10 +0000 Received: from fsr-fed1964-102.ea.freescale.net (fsr-fed1964-102.ea.freescale.net [10.171.73.17]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vAHDcbAt004692; Fri, 17 Nov 2017 06:39:06 -0700 From: To: , Subject: [PATCH 10/10] staging: fsl-mc: use device_type instead of strcmp() Date: Fri, 17 Nov 2017 15:38:34 +0200 Message-ID: <20171117133834.4635-10-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171117133834.4635-1-laurentiu.tudor@nxp.com> References: <20171117133834.4635-1-laurentiu.tudor@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131553995504347364; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7966004)(336005)(39860400002)(376002)(39380400002)(346002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(8656006)(4326008)(2906002)(50226002)(54906003)(104016004)(39060400002)(50466002)(16586007)(53936002)(86152003)(316002)(85426001)(2950100002)(5003940100001)(68736007)(8676002)(189998001)(81156014)(110136005)(5660300001)(86362001)(81166006)(7416002)(6666003)(47776003)(6636002)(305945005)(2876002)(36756003)(8936002)(77096006)(48376002)(498600001)(356003)(76176999)(106466001)(105606002)(50986999)(1076002)(97736004)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD043; 1:FhcWQA2ynOoFpVmrrKhV2v7BY8WoJjRXY4YQk5l71bAXnvT1nrmCZR+qyDLatjhma+b+uHrx907sEYY6Drw59yJE8oSjaNw2Dg1SoHvsrBkL1xFuneg44PE34eIaIvrw MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83cff9d0-b762-4f8d-7c7b-08d52dc09533 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4628075)(201703131517081)(2017052603258); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:jB8ZS9PEcx8SsgeqvkUW7gfWeiFVVz5VliZVyOa8isxUN8mAtR5FLPHC7PIt8pbxr8jqGRT7vNwGRjUpOlVny3frV+WHU49vbD4QCycVoCeSLyK/q06SVjzFsrniU4gySh1+EnhjN/aUUhgXtkdWgUgz87fJo4uhFWBfysddvOnj0+Ki1Wq+IwI40ZjipFEQlfsSOqkbirlYZIimjCPwpq5DRr8EW9F+Nx7rmxklSTItg7MQuBJJCoLgA3kZlBXzsPX7cSBH+uD92ADGefzCZpR/7U3KDn+QNdq8ZXCeaiz4ytqM9uojaJm57kkVWuy0WczzKy9nqS+tlGTl+qsPjzUJbBs06nmwIWxctj1N9rU=; 25:RWkJ9T/Bwd5PiokaCndXAKBK+PjIT0T/q0K46GRfFWNAtXagsGHpihG7bIQ5VomwkllfMynBaRyaFU3dwA97orMMf2VVBkYObSmIrV4ORkSMaIgh1R2m3zwRMnaxPlUGxVWQafFMamh0Xh53XfqGdXny5zBm/KXujPEFjD8b2b0YR/yBVJiXlfFWLhKTUJWUxdi7nD0LxJ2Sa9t55qF/mAR6xiy+HIsYdAeAhMt3SF+FecM4OWmO9S39fI3EVyGztC2QAMHzLoTqd98x7qniNg97Xx+K0qSqYXOhuL+gp3FzFGCMsy2v2wWeNFydAk/nIBp02HyoTOFHwGqp7SbMYQ== X-MS-TrafficTypeDiagnostic: SN2PR03MB2365: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 31:4hAEHox8kn3iw8ozaQvSPuHR979btfpBEvSOTCfA4ss5v6KD5PHFqjNOzDidplK7WutUxX1GQSgnhGfvCOcdyYUKOLWJeM4eY/In1HZxMJOMPzs/nHCc3XFyVlG5pYnO4k9rjDMLPIRYl4QLz3lin0kQd/CoRSHHztuu+agozUdh3s7alJO0cLu4dDjf2J1IdbNFrCErid9+MMsxtDhJ6gGKSTSdrkR5WC6upXzhZVw=; 4:6K9E6zA6bCH87DGcmUwjsaiDhpI0q0XsdNO7eTxThzaZipjKVLMgClOCV2od9WXYy4HRzDkOzUcWTWAClbW6KIKPCmLgik9++XlFfEJeWdhuUJhww/B+tXQgh6oVZCl1cSBN0YXNhlYxvWJchQ5mGqZFfs/wZw47/Gd0mErxglNu62LmDdYPSDTPWBiPaanWuIL0P4mOMN0HSuZQif6/JOiMsw3dKSKZBtznsNji1SnKU6SG83EdM/AagqqcwzVe3AqHGEVC4rQD3kP5sD5mB0jlS495fLUTRYdV0CvQ78wY3XtMpG66frJaTL/F+DeR9mVn4okTG5h5ABeeWe+1HA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(3231022)(10201501046)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123559100)(20161123563025)(20161123565025)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2365; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2365; X-Forefront-PRVS: 049486C505 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2365; 23:OXiQIukcOZSqsPumiZB/bLCblhVfG2Iq2FbBSH7uC?= =?us-ascii?Q?sDxpUYuO1nfJJDouZRWN88TriA1HoSaUU1CgExhFmDyMxlBocIDdXW6l7cGq?= =?us-ascii?Q?jQ9D/1qL0ypPpWTLvWjXAYnLMDpG8lbVzoHVr+//ir5pT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jW1x2M+wr9K7Yf2jGp31hdZRIWJsytwBpibSR1fKhxUi5fQAWDJ3RlgKo3S750FKaQrSySaMDgzl8MqRt6sD4Huxe1JycanpgdJ23TQo2TU1zgcxo4LVe3F934HHDtHKcEeUP8d2x7tv01ClD1kukzOwuIu8TSSNw9NrehVY1JdzTQPQB2xFmyMLCSOYbq7fCfb9LbNYYUa1IHaEm8ex7xCLKOi9 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2017 13:39:10.1227 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83cff9d0-b762-4f8d-7c7b-08d52dc09533 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2365 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171117_133944_340601_23A2EF29 X-CRM114-Status: GOOD ( 20.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, stuyoder@gmail.com, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, leoyang.li@nxp.com, bogdan.purcareata@nxp.com, linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Laurentiu Tudor Replace strcmp() based device type checks with the standard device model type. Signed-off-by: Laurentiu Tudor --- drivers/staging/fsl-mc/bus/dprc-driver.c | 4 ++-- drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 20 ++++++++++---------- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index 28a6b87..131c715 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -593,7 +593,7 @@ static int dprc_probe(struct fsl_mc_device *mc_dev) bool msi_domain_set = false; u16 major_ver, minor_ver; - if (strcmp(mc_dev->obj_desc.type, "dprc") != 0) + if (!is_fsl_mc_bus_dprc(mc_dev)) return -EINVAL; if (dev_get_msi_domain(&mc_dev->dev)) @@ -745,7 +745,7 @@ static int dprc_remove(struct fsl_mc_device *mc_dev) int error; struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_dev); - if (strcmp(mc_dev->obj_desc.type, "dprc") != 0) + if (!is_fsl_mc_bus_dprc(mc_dev)) return -EINVAL; if (!mc_dev->mc_io) return -EINVAL; diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index f7fbebd..1000fb3 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -14,11 +14,11 @@ #include "fsl-mc-private.h" -static bool __must_check fsl_mc_is_allocatable(const char *obj_type) +static bool __must_check fsl_mc_is_allocatable(struct fsl_mc_device *mc_dev) { - return strcmp(obj_type, "dpbp") == 0 || - strcmp(obj_type, "dpmcp") == 0 || - strcmp(obj_type, "dpcon") == 0; + return is_fsl_mc_bus_dpbp(mc_dev) || + is_fsl_mc_bus_dpmcp(mc_dev) || + is_fsl_mc_bus_dpcon(mc_dev); } /** @@ -43,7 +43,7 @@ static int __must_check fsl_mc_resource_pool_add_device(struct fsl_mc_bus if (pool_type < 0 || pool_type >= FSL_MC_NUM_POOL_TYPES) goto out; - if (!fsl_mc_is_allocatable(mc_dev->obj_desc.type)) + if (!fsl_mc_is_allocatable(mc_dev)) goto out; if (mc_dev->resource) goto out; @@ -105,7 +105,7 @@ static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device struct fsl_mc_resource *resource; int error = -EINVAL; - if (!fsl_mc_is_allocatable(mc_dev->obj_desc.type)) + if (!fsl_mc_is_allocatable(mc_dev)) goto out; resource = mc_dev->resource; @@ -442,7 +442,7 @@ int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev) if (irq_count == 0) return -EINVAL; - if (strcmp(mc_dev->obj_desc.type, "dprc") == 0) + if (is_fsl_mc_bus_dprc(mc_dev)) mc_bus = to_fsl_mc_bus(mc_dev); else mc_bus = to_fsl_mc_bus(to_fsl_mc_device(mc_dev->dev.parent)); @@ -505,7 +505,7 @@ void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev) irq_count = mc_dev->obj_desc.irq_count; - if (strcmp(mc_dev->obj_desc.type, "dprc") == 0) + if (is_fsl_mc_bus_dprc(mc_dev)) mc_bus = to_fsl_mc_bus(mc_dev); else mc_bus = to_fsl_mc_bus(to_fsl_mc_device(mc_dev->dev.parent)); @@ -575,7 +575,7 @@ static int fsl_mc_allocator_probe(struct fsl_mc_device *mc_dev) struct fsl_mc_bus *mc_bus; int error; - if (!fsl_mc_is_allocatable(mc_dev->obj_desc.type)) + if (!fsl_mc_is_allocatable(mc_dev)) return -EINVAL; mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent); @@ -604,7 +604,7 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev) { int error; - if (!fsl_mc_is_allocatable(mc_dev->obj_desc.type)) + if (!fsl_mc_is_allocatable(mc_dev)) return -EINVAL; if (mc_dev->resource) { diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index aa935f3..f84bc14 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -442,10 +442,10 @@ static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, struct device *parent_dev = mc_dev->dev.parent; enum dprc_region_type mc_region_type; - if (strcmp(obj_desc->type, "dprc") == 0 || - strcmp(obj_desc->type, "dpmcp") == 0) { + if (is_fsl_mc_bus_dprc(mc_dev) || + is_fsl_mc_bus_dpmcp(mc_dev)) { mc_region_type = DPRC_REGION_TYPE_MC_PORTAL; - } else if (strcmp(obj_desc->type, "dpio") == 0) { + } else if (is_fsl_mc_bus_dpio(mc_dev)) { mc_region_type = DPRC_REGION_TYPE_QBMAN_PORTAL; } else { /* @@ -520,7 +520,7 @@ static void fsl_mc_device_release(struct device *dev) kfree(mc_dev->regions); - if (strcmp(mc_dev->obj_desc.type, "dprc") == 0) + if (is_fsl_mc_bus_dprc(mc_dev)) kfree(to_fsl_mc_bus(mc_dev)); else kfree(mc_dev);