From nobody Wed Dec 31 08:30:25 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E78C4332F for ; Mon, 6 Nov 2023 18:41:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232369AbjKFSlH (ORCPT ); Mon, 6 Nov 2023 13:41:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbjKFSlD (ORCPT ); Mon, 6 Nov 2023 13:41:03 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B97DD6A for ; Mon, 6 Nov 2023 10:40:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699296059; x=1730832059; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5VO6DPoM2p3Mtjo0hiJP2G4WEIXi30lKtx7rB1dBncU=; b=d9UXBZyhnolq/Lot+/bqx5TTa5+j3Gw+GCKTFSlKhoFzlAmmuW+Nez+c VMRWp2tTM6UxKvcqlEhXFzRFL3fNnham3niG8NAQMQtV8uJegGXcnYVxI WRf/uZEVqrKXP+jR6j4F9w6hZtMzTEaJqwFKpax83vuUNfQdZT5Y8ansH 9PXw8P3p2s0+LquLwaKSgNeDqHpk/s84fsxeKbOEnsk/xVhccUMc0cnmI 73+WuO39EqxxCopD2wjvkNrwK2fdDbGwDE8em7/QHBgb+MpQXcD2WfDMr raVbsbOsmdJV32n0PpgsnmStC6Y3xuA8z1PJuOG86P8T4xc5ybe6BRhlH g==; X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="369549381" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="369549381" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 10:40:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="1009622595" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="1009622595" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 06 Nov 2023 10:40:56 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 448AE17F; Mon, 6 Nov 2023 20:40:55 +0200 (EET) From: Andy Shevchenko To: Jarkko Nikula , Andy Shevchenko , Chen Ni , linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH v3 1/2] mfd: intel-lpss: Use PCI APIs instead of derefereincing Date: Mon, 6 Nov 2023 20:40:51 +0200 Message-Id: <20231106184052.1166579-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231106184052.1166579-1-andriy.shevchenko@linux.intel.com> References: <20231106184052.1166579-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" We have a few PCI APIs that may be used instead of direct dereferencibg, Using them will also provide better error codes. Signed-off-by: Andy Shevchenko --- drivers/mfd/intel-lpss-pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index ae5759200622..cf56cd3a40ee 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -37,13 +37,17 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, if (ret) return ret; =20 + ret =3D pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY); + if (ret) + return ret; + info =3D devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; =20 - info->mem =3D &pdev->resource[0]; - info->irq =3D pdev->irq; + info->mem =3D pci_resource_n(pdev, 0); + info->irq =3D pci_irq_vector(pdev, 0); =20 if (pci_match_id(ignore_resource_conflicts_ids, pdev)) info->ignore_resource_conflicts =3D true; --=20 2.40.0.1.gaa8946217a0b