Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754989AbcKBFip (ORCPT ); Wed, 2 Nov 2016 01:38:45 -0400 Received: from mail-sn1nam01on0041.outbound.protection.outlook.com ([104.47.32.41]:52574 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751798AbcKBFin (ORCPT ); Wed, 2 Nov 2016 01:38:43 -0400 Authentication-Results: spf=none (sender IP is 192.88.158.2) smtp.mailfrom=lvd5587.freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=nxp.com; From: Sriram Dash To: , CC: , , , , , , Arnd Bergmann , Sriram Dash Subject: [PATCH v2 2/6] usb: chipidea: use bus->sysdev for DMA configuration Date: Wed, 2 Nov 2016 11:08:09 +0530 Message-ID: <1478065093-6923-3-git-send-email-sriram.dash@nxp.com> X-Mailer: git-send-email 1.7.7.4 In-Reply-To: <1478065093-6923-1-git-send-email-sriram.dash@nxp.com> References: <1478065093-6923-1-git-send-email-sriram.dash@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131225387201690164;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.158.2;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6039001)(6009001)(7916002)(2980300002)(428002)(189002)(199003)(5003940100001)(19580395003)(4326007)(97736004)(8676002)(305945005)(229853001)(50466002)(5660300001)(7846002)(33646002)(68736007)(81166006)(586003)(69596002)(7416002)(42186005)(11100500001)(356003)(2906002)(105586002)(626004)(106466001)(101416001)(81156014)(8936002)(48376002)(45336002)(6666003)(103686003)(4720700003)(50986999)(90966002)(92566002)(8666005)(50226002)(87936001)(46386002)(76176999)(2950100002)(19580405001)(5001770100001)(47776003)(36756003)(42882006)(189998001)(86372001)(52956003)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0301MB1626;H:az84smr01.freescale.net;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:1;A:0;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC003;1:881Fi4joZWGuin8wEsF5pA7JLvR+nC3jSjL9fy2lEAIq8hvTzOiEMg1tJc5VS7xNXj1xId5Z1zd39u6zWCfDkVpCsRgSBzNQXn05GKzPr3n2Abdb9lBEjLIPRm//3rd4yx0iKVgrC6QVKeKgvz7AiFSVhHdE5chT2Khcpfgu+mZK0fAXW7KSRJACPC9kh3iuKH8BqSr033tHIyoLKY2Ou0FjKZ2uprSU3v1UJ5qg0TgRG8OeuoiHVK5PdpXokm8zGz44pmHu9XZudHtF2rS+8oEq1XApDdEcGSrbwBZPsigfKo8kfjewGx9R/9hcFcLjVbEtLaZqhBPmALhziAaxdMCKbcRVSiykCzLbgdST42rkweM5Bfmup3ezK/6rd49BJTYkKAFSL59ABCP7m91tvIE/uuCeBr1tdlz3C1OB4XDfxbzpjPFbdpF7eO/cfsIPmR8u2cY5Dxz62Q6fIdtJXzhqDK18jlP+x0JGolZLFbhrGL5aJ/XQADzd2sE132xvtpg/+79vQxvjZ9X5bp6kL/uqawOa0d90E5MRtg5Y0G7nDRX6ksWSMkZ/HjDbBneAWMcb+esGN5LIqRoez6000pLpp3W3qqdtYOa1MqnRIqdneFa7gu6gbpyytQP6thnIjsAuTOV8sg2gQ3L+m78wiw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ed371bd0-7a5c-4671-18d5-08d402e28020 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1626;2:Hp8M3Xzgn/1MH0q2a9AY8qqt1RcdLl5f+21jtD2hVtGEhPvxP5dWWGe2ASye/dZafC+Kb2LyRJ1bIWxZY/q8UsECSdDND1IFfyZyVGOx87YsH9OqNLNpmR8kIfpDBXCXVC1rodGhTwL6LMy0OzEbRssFl+VT2qVqweHUPJTK3t6Psi1MTMSjEZAjrsm5oaaE1BoYbH6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Wvzp40MgiEPkLJ4vGZxJcEV8++cokQavIK0jnbh1POXjLWA49VQ/cSb3o6X41Eo/61t1a47vQMO25GwsWUkKLEPDLlSbzwo+Tc0ffIgeEVRlJ1gPo2ZJ X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1626;31:I4jpCswhSNqW1trgYVh0prcO1zpcg/dWdhh0f8DZMLmLY2nhbk6riZjaYsCa/2z8bcWdTZEXIs3iqE0HWfa3sERIm2PYv0PzSeVRVZS8RELT5UlIeHAaWl8rxg0mThCB8CHhEGqNr8Rh8e/GwfDnf1UFxcnz28qmBbXp/ng77F3RrAP+WKTfZrq2u9qNdmkZBaIKIZYM7AhVpZSwE3BUUmvRS751D+jWMl7q9H1wy+BqzXjZH0sWmAJfgjZ5x6JfdBtM6xqFS3btzB3ljWDZUg==;4:obgdAVr2bvO58u3RvQG6cRrdaOYbdvrfcnrxCmlB+99OA6FCRtpNJCaDsGhvhs0wRZjeWmP6NuOrivq1tvbGXHh0bTJAH24lhf5zugJHizw0y6yTwlH7t785Oco9yY5z4JLww6s5JKRLKGdNo7upJbbS5yveZtMkNVkRctCPw14dV09vMAqqOgiWFnXtgbM6E2qQAZ9/UDpG10UL+jS7aT5CoJhxqdq8IMs24AKqgk4WrVgOnfqytP6B0HC9181pf3I1aGSdFWk6wAI6bZQ1TvIallvBWix1ELOyqIVCiFNtV3JT7Z6WKGf/Xmns4V91B52wH3PBzEXXtx2dBpopH4jHA5yO6+f7BNwrvKSM6CZxszBxE3cMLl6Gw/KQO7NwY4USjEx3CpOxVR5kf1NsYrDOyexeUb6VGC9YUXJsjzfKo39iYw+QQnAQCYnZ3apmfolmIpnJOT3+mCdjQdQphL253qp/R/wYanppKRpe6zu0CITp/8fgSZhBxBz16/9QqtBo77OrmmBTRxvkMbWRWAGvfUaKUGSGimbgI3O+zWSP+5NQmki6BQLP8FSUYCYx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(13015025)(13018025)(13023025)(13024025)(8121501046)(5005006)(13017025)(3002001)(10201501046)(6055026);SRVR:CY1PR0301MB1626;BCL:0;PCL:0;RULEID:(400006);SRVR:CY1PR0301MB1626; X-Forefront-PRVS: 0114FF88F6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB1626;23:HdkmOH9hXYpN2RLXRwX0mZUQR2VDpflDLmlXsnL?= =?us-ascii?Q?FnsT+QMt4oW7r00iMPP4Ud8ZnyNYpwCfyB7NUrFhcPI+A6co8YMmUXp5kkQE?= =?us-ascii?Q?mXg26N4bEt4C9JK4C+la4dmZaBCM7wByFFFw3uu7Th8Zlyz9Wx5jnSAGmUq5?= =?us-ascii?Q?x3f3JZG1e7HZoTrga6LIkYX0Qt7fj9oD/Uc82VN0mLCuvY3EF8NHTMwpTyMs?= =?us-ascii?Q?bxoLbF2G8ixdtFuEzIS+TGtnyDLReYJwxMQJqaTTAgwAn/8WSDaghG/LBSuk?= =?us-ascii?Q?ci9a126OF/xcPEK54yanF+UfISNV2XQWwhU0827GNH8AOp1LPjCn7hTzBopA?= =?us-ascii?Q?YiFHpfmRRQqY+Gg8CxzN2QD4vtfvz/aH69oHn6Iax26TSuKizJ4fAXXB3B4I?= =?us-ascii?Q?WGiiMVPccUyliVZGVbFhUhSp51eqOjfQQtduRpQdsdNMO4VMVV9umwBTyLbL?= =?us-ascii?Q?MblTCKbNgGBUFOLtez+Z7g2I7U23K82A/a65bRptBq3OvrcltzxoPSK+ejOd?= =?us-ascii?Q?9cdVnVFfshZCus0F0jvcQadkkVI9AP/linX50Dz/tjWU7BmLUQY6xvXNRfjk?= =?us-ascii?Q?nPR7TIVCAlDxuKgEo6nK3ZieZPDpZdTyCW84gUsnq731hl0GzujC5HFLuKP6?= =?us-ascii?Q?tZQ+KXbKW35ZB3pUwIAI6RGQdPYwkZ86Bu6x7qQ5Bv5VSB6sK/ekOFQMtatI?= =?us-ascii?Q?ELBu8eX+jpYTLm8nmCuM3pJWpeNkkxd6WwFS9XBrqsK1rdXx7NDUkWwoidon?= =?us-ascii?Q?MJm8pE275w0k3yd2BiTLa0nS7WS7IPTAHj7qhuglELmA/6H/PLwjq1/BtLcy?= =?us-ascii?Q?OXQPcgBa1UB2g7N2otNskH3lDjtxB7Na1PCf1z3us/Fp72Vu2/HIkKra1gSE?= =?us-ascii?Q?GeXAL7PysB70pOA4L9lNaxf2TTWf4TPnba8a5k0qGNY6qEQkudCX2rlvsPdM?= =?us-ascii?Q?rWGiTefZdnkI17huPoSe96/oIUl4lUov3X3l+uajzpNENaqgsYj7cvbnnH30?= =?us-ascii?Q?oTp7DkrVTDDXjU8OQjJBlqVUM9pOo2uCArPzPKtOgAazAstLQSvaXe4KKNYw?= =?us-ascii?Q?aAfSCiv9xRaKJ3N4DhxlkQH9S42Ls3r0z5KsjmScS//qapEPZmrpneNKf9M8?= =?us-ascii?Q?JjT2jcyhngO5LNDbaoHEdxyyGL8Uk9VEqt7w3dJo+4+cRwM+/D11YDBLdtE/?= =?us-ascii?Q?AN50ZRPzfBOwe34VYMvE3899ZrVjUkWewusfSh3R98QnOVsdI+cRDmg6jMCK?= =?us-ascii?Q?9fBkAKN/Hz+Sy1RDbZyf+ap49JYMm33X0vgNGCgUR6JmRFHyvHq9buEfKBAv?= =?us-ascii?Q?mCFG7CKLfH33oAagGc1GFu45HLThraWufZPFgHVWtEDEs?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1626;6:u2VOXBmGxf5KH4nR1JZAx67B7qM0nwTi9xw3kXQfK956w/fXnGeJ17TRjw+Pur5vBGXkbItMBwozcweIoTq3mSdEd37ViR4+rwHMlTboi69AZW7/QPJlQ/D/wl1vRdPcdhiOsEhKPecUtKo1jV22NgpYEdsfv+efcqavqhE2Uh/VbrKMvzzLxaEFzb/kOxHhYOiYsWmbIWYEHC5XVheHe/YAcoQdEoOwADF9GqE1qUioeXlHrU8IKHvQ6ayKqO0Dyj3qDdPda+juvjxU/9M7nuqqo46ZsFjvErmxktlDiA24G/8hlapUzegSV0oJCMW4;5:NUVdKn4eHvi7BDeEQUcubN2G1RTOFSSLJg9jfb4vwwtDOo+AEq3ayE8jBP4SiZBTXGE0r9gkKOrtdjit+l2MF8kC7QgPVSHwS85Chlr46qikX9v+cVMw9sK4VGZ4CQCcrnvPhiOoLxO9VNjF3in8gBQPyQey3g/JUknXSZ4qH/qMdjDOGM97qBI6tUl4KeOx;24:T1lAAIsj29fZ9SyLINFGR6S9lXAySDSP6QPxDnHhvY5C71jSZiZQQZ451/YebIArMRW2c2i8KzCSDE5ZI7mL5YmzKClwbt2bpbLWtkjMDoM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1626;7:rU2C1eKu4FErS3q/ZbBMOH3Qjx6rFaY+dvJp4M3DlqibPgJK4X6kS9C+qkZ1UTE9DpnoWcRq7ASwbLDsjQNYfHNtqHpQYltDGISeOLe3+eXnTxq++7na59GKQ9qlOHxqqDKcQhLJaCiv1ponXTXnt4HA8Kr1eHLo6EmK714thEZD9qWdfZ8iODSjJldmgbr/B8Bqn6HWqHm1Ipjk6ZR6THfCoBTYEm7yVmriZuUMTvlLHN+r2M9gz5UJjhLpG+XusLpnn1fknd2Gli8F9LmPeAoDRMSHdHFdwy6SByJ3sCWmSEDdjQL93RALvitGZIiTGcq38gUdmDqEGuUYzZrte18XjSkh0EP7PmyKmJNpJhE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2016 05:38:39.9038 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1626 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2879 Lines: 87 From: Arnd Bergmann Set the dma for chipidea from sysdev. This is inherited from its parent node. Also, do not set dma mask for child as it is not required now. Signed-off-by: Arnd Bergmann Signed-off-by: Sriram Dash --- Changes in v2: - integrate chipidea driver changes together. drivers/usb/chipidea/core.c | 3 --- drivers/usb/chipidea/host.c | 3 ++- drivers/usb/chipidea/udc.c | 10 ++++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 69426e6..8917a03 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -833,9 +833,6 @@ struct platform_device *ci_hdrc_add_device(struct device *dev, } pdev->dev.parent = dev; - pdev->dev.dma_mask = dev->dma_mask; - pdev->dev.dma_parms = dev->dma_parms; - dma_set_coherent_mask(&pdev->dev, dev->coherent_dma_mask); ret = platform_device_add_resources(pdev, res, nres); if (ret) diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 96ae695..ca27893 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c @@ -116,7 +116,8 @@ static int host_start(struct ci_hdrc *ci) if (usb_disabled()) return -ENODEV; - hcd = usb_create_hcd(&ci_ehci_hc_driver, ci->dev, dev_name(ci->dev)); + hcd = __usb_create_hcd(&ci_ehci_hc_driver, ci->dev->parent, + ci->dev, dev_name(ci->dev), NULL); if (!hcd) return -ENOMEM; diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 661f43f..bc55922 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -423,7 +423,8 @@ static int _hardware_enqueue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq) hwreq->req.status = -EALREADY; - ret = usb_gadget_map_request(&ci->gadget, &hwreq->req, hwep->dir); + ret = usb_gadget_map_request_by_dev(ci->dev->parent, + &hwreq->req, hwep->dir); if (ret) return ret; @@ -603,7 +604,8 @@ static int _hardware_dequeue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq) list_del_init(&node->td); } - usb_gadget_unmap_request(&hwep->ci->gadget, &hwreq->req, hwep->dir); + usb_gadget_unmap_request_by_dev(hwep->ci->dev->parent, + &hwreq->req, hwep->dir); hwreq->req.actual += actual; @@ -1904,13 +1906,13 @@ static int udc_start(struct ci_hdrc *ci) INIT_LIST_HEAD(&ci->gadget.ep_list); /* alloc resources */ - ci->qh_pool = dma_pool_create("ci_hw_qh", dev, + ci->qh_pool = dma_pool_create("ci_hw_qh", dev->parent, sizeof(struct ci_hw_qh), 64, CI_HDRC_PAGE_SIZE); if (ci->qh_pool == NULL) return -ENOMEM; - ci->td_pool = dma_pool_create("ci_hw_td", dev, + ci->td_pool = dma_pool_create("ci_hw_td", dev->parent, sizeof(struct ci_hw_td), 64, CI_HDRC_PAGE_SIZE); if (ci->td_pool == NULL) { -- 2.1.0