Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2269553rdb; Mon, 20 Nov 2023 06:48:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGu/VsgTk55Vx6jMwCZ89NvMoiaFPat4h5XYN0w9uHMI9m6/fYvf6kKSebjNLsTatk7uRou X-Received: by 2002:a05:6a00:2410:b0:6bd:7cbd:15a2 with SMTP id z16-20020a056a00241000b006bd7cbd15a2mr5723404pfh.26.1700491701303; Mon, 20 Nov 2023 06:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700491701; cv=none; d=google.com; s=arc-20160816; b=AIkHhw1Ov6vV2ca+g04L4SP+GkD8naKknZPlA2xXql7Sygi+PKjhhiwOFkLL2OvT23 0M3euh78AHWBusbbi6eInZPmylnaSap5BXux4X1zgEonW0I4agQiouQAwUghxsFF7KhZ AAkZC3B9Ik/dynQ+3t6Hin6hkVlTw/BNx7i+G4aOvljB8qH3P7smggCR29WPy6D59cio T9IybXCwlDDI2v17f+H7KBqscnEHrCJFCOnQ1/gNbVRBreokg+IUP8YIaEdpqpZ9nCsP Qe+DjYk1WwFVtSmkJhUXI4oohX9eMEXNA2hgCWFXS/+OXTgOkRMia5nAtDQrqZR5yS02 4LHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OcolVTAuuFKHn23haQ4qgVvwmpwrtjrnG1jUKIv8erc=; fh=g3amdiifXhwL/mTWljo4oOX/iLvH3RCBC8SWsJqOWek=; b=gKanUO78tbsvDhqyhQt5jz9vMI/iHIYiz/ZVPXDlxuHZIKfJguEAIvzYmJUATE8Rmy 36BVKAtZn+Eo6sidc5HJ1B1hVHC547IzHtWAYmjxxRjUaskrdaISImBBywASqgTqjJTq 8nStGDbUqrqp73TIqXAbHu0JKtNl5+7UaBooOTgxz4hnbcWF3/+putaxYSxmTpJS2mju RGNBCyKYEhma4sIhj9VktF3aIXVdHSzO1vEu3CYdHV0cKgf0f72www4tve1bLq1aJrjT ECExfbMH0a7IBbYSEr/SKrAa/Cfbi6qjD5qauUGVUPHFj16eq8xWYw//AlnF/2hkD03m zsNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ApKoZJWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id t10-20020a056a0021ca00b006cb8abd39d3si2914600pfj.180.2023.11.20.06.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:48:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ApKoZJWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B0E808032FBC; Mon, 20 Nov 2023 06:48:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232607AbjKTOrB (ORCPT + 99 others); Mon, 20 Nov 2023 09:47:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233638AbjKTOqy (ORCPT ); Mon, 20 Nov 2023 09:46:54 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0382A4; Mon, 20 Nov 2023 06:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700491610; x=1732027610; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gttshKJrMZpIh+yFG4GEE2CGljM8HFTYcNc2C9Ugs5s=; b=ApKoZJWmMNrMBI00iNjbG2VAlwimxaq3A1PqBjfEhZ1vzOxeIoa81IoW bi+d1sfqyapaegdcSAXXWUFlueBV/ATERjMYlSoO9bD0YfYfqZIO6jGv1 xghScxH0BeJBWYl27fuRNQjQnuJbhpxrbI9d7ucAb/uCPwfgvV5h0dQcs q3J4DxR1V8n/QJDI4Lp5Vvx0fmkt+TjtK0rBFDIgjlAocDG04elqjIAGq 6pHiMJ6aa6S+EJAycoyVRG7U4Qp7nhBt6FPrLN65xZI3+pfUX16R3bi7Q Nuz/3lc6XG8Hl5EZ+ytpQOj49y1TNDGRCAEkCqetGI7nsDLolZrdf3wtO w==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="455956441" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="455956441" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 06:46:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="801193127" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="801193127" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 20 Nov 2023 06:46:45 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 47A3812A; Mon, 20 Nov 2023 16:46:44 +0200 (EET) From: Andy Shevchenko To: Mario Limonciello , Jarkko Nikula , Herbert Xu , Andy Shevchenko , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Jan Dabros , Andi Shyti , Philipp Zabel Subject: [PATCH v4 03/24] i2c: designware: Let PCI core to take care about interrupt vectors Date: Mon, 20 Nov 2023 16:41:45 +0200 Message-ID: <20231120144641.1660574-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231120144641.1660574-1-andriy.shevchenko@linux.intel.com> References: <20231120144641.1660574-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 06:48:09 -0800 (PST) PCI core, after pcim_enable_device(), takes care about the allocated IRQ vectors, no need to do it explicitly and break the cleaning up order. Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-designware-pcidrv.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 61d7a27aa070..e67956845c19 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -295,10 +295,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, if (controller->setup) { r = controller->setup(pdev, controller); - if (r) { - pci_free_irq_vectors(pdev); + if (r) return r; - } } i2c_dw_adjust_bus_speed(dev); @@ -307,10 +305,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, i2c_dw_acpi_configure(&pdev->dev); r = i2c_dw_validate_speed(dev); - if (r) { - pci_free_irq_vectors(pdev); + if (r) return r; - } i2c_dw_configure(dev); @@ -330,10 +326,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, adap->nr = controller->bus_num; r = i2c_dw_probe(dev); - if (r) { - pci_free_irq_vectors(pdev); + if (r) return r; - } if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) { dev->slave = i2c_new_ccgx_ucsi(&dev->adapter, dev->irq, &dgpu_node); @@ -359,8 +353,6 @@ static void i2c_dw_pci_remove(struct pci_dev *pdev) pm_runtime_get_noresume(&pdev->dev); i2c_del_adapter(&dev->adapter); - devm_free_irq(&pdev->dev, dev->irq, dev); - pci_free_irq_vectors(pdev); } static const struct pci_device_id i2_designware_pci_ids[] = { -- 2.43.0.rc1.1.gbec44491f096