Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2327310rdf; Mon, 6 Nov 2023 10:41:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFY+nOw7JXLdaVFl1Be05Jg1k+t4XWvIGKMpiwj+zie49+nSWhOQe+2eRpoxJBpOpSaYj5j X-Received: by 2002:a05:6358:9214:b0:16b:7049:e901 with SMTP id d20-20020a056358921400b0016b7049e901mr2400358rwb.3.1699296094418; Mon, 06 Nov 2023 10:41:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699296094; cv=none; d=google.com; s=arc-20160816; b=YWWDjDISVmlgtPIoK2pjWp7BQRqh8OvG6zlPJQBwVcu4UP32pP766cSahjxywz6ziO 6+SLgrt7uLLLLkXJXr9TPlQfbHkI/yZPOhZ/pwOYyaJMd3tVFx+lfvVe7dy08mT5E0NF Dhzoqvho7Z2R41yjoml6s/fAf+sRfPOu7g0T5jekLLm7mE/KazXF7OTv73fWp2xfUA2N i4jarG9Im3SAKZdBAABvcYsmLco9vMcUSH7xFil6h9qaM6uWJnPSGpn2JEp8AVD8hFcI suCfuYLFDc0XZab/ug/sRawZpNEAyjvcq+sK6v89DFs+DszsG9X06Vj0N7oMTlrtTnf2 PgTg== 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=Q6t0XWSuQTfZTahmvB7z+6SGO1FxwOFGWpHSYLE1rp4=; fh=EhYQnArFbMHj9GetyMtC39fFiEl2zsDTlAIuGjtTRaM=; b=HLWgGAeHHAi1+76yfRDiXZ2JvD5EF0c/39JRNXx2iuKXsMB5C9f+Z+0BR3a9CMtQN2 1kfaNRVx/AAr839jY0yTjWrd76OG7gxGl4b2FCKfQORtH1D2PNISgqScUC8cbQ/ozrwE sWiu3FafthseQTmU7EsyUg/BUYqSgbHFM2sRPzkQlK6cNN5VI+E9tI4khllG/NWb0S1T BAT2DUGYE3v5RWRcacxYGM4Ai6WxIa4cKpnZ4wFzQvX3vAy15sVURO4Fvf76u27uv88M drZduUUVvQdgFZg0CllCLFefNyLr01yEQ7Os5tmfhNpbhWKmGpRoU/HSk89t10expEEc BEFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d9UXBZyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id l184-20020a6391c1000000b005b936900e26si234734pge.713.2023.11.06.10.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 10:41:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d9UXBZyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 6D9E080A532B; Mon, 6 Nov 2023 10:41:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232279AbjKFSlH (ORCPT + 99 others); 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: 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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 06 Nov 2023 10:41:28 -0800 (PST) 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; + ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY); + if (ret) + return ret; + info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; - info->mem = &pdev->resource[0]; - info->irq = pdev->irq; + info->mem = pci_resource_n(pdev, 0); + info->irq = pci_irq_vector(pdev, 0); if (pci_match_id(ignore_resource_conflicts_ids, pdev)) info->ignore_resource_conflicts = true; -- 2.40.0.1.gaa8946217a0b