Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3758021iob; Mon, 2 May 2022 05:06:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAKWC8BqnxhfDWOl+u5SZXNSlzdMTTEqNuDfy0cifqkjbj28/CMwKZfNwtqz4r1skW4d+W X-Received: by 2002:a05:6512:2249:b0:473:9d69:9705 with SMTP id i9-20020a056512224900b004739d699705mr3271691lfu.351.1651493215069; Mon, 02 May 2022 05:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651493215; cv=none; d=google.com; s=arc-20160816; b=hsgrjDyJnozWR4H1ZOddLH1WPhnwnF/iE6/EMV3x5NndgZKJvuelmEJpA/JDgb7XVK aVQRfvdLd4bqTc86UNj2PCNcaAZbe5xR0Ur+nyGl1IrAV3HHz9ZeqDSc5LTqIWxyAc1U 6P1bynMZkvt2vfUDie5bab5vPkE5VKnCGs5057yxLd5kaP+KxpY7WUYROPN9PL9MwkBt 6b8Y76tWvW5FEnEQR4UDR9Tzo3Fvb1gHadVnzzwQodf2naPlXMRQY7GHNa7P8TQkJp+f MLdRndgUry4SgU39WWasHTitYXG72a6lIC93t4KKxSs2quKWrGxv4G1ca9ls3mGzuPR3 6W8Q== 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=P0Afusgf9bfH6Ct37EAyWAKT/nUUPuuykzec1wMuPs8=; b=Obvq32unoorxrCkrosZi4ErEK7cJr4OCbwuiB00+XixaTYFW9g9vlwPqpBtZhu1od6 eXYSsfV0xlfEobKz0GUk3FYqDuohyWNQtX8muuOM7z42J+UsW3L0dHk/C1iESeoeJbfE FyPzG/EHtU8sXBpZvMt+R/T309kn4jkNxyAeWvL/1vDP0+hEMhWEg/rIZv9OXMA4eWzp sQljPxM9DIBRTQ7az5XsNPlAHNVTC2rwwRa1G8hex4wMU6D76KXEjOJyFRlxkSeVAxZu C/TGT9rfog51l5Ay67Z0I8Pu+KFrZCqcNtCR9Yo4W4nssM1eQADjuc7GMEY0m9uMZ/Wk YJlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=RzU01DUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a0565123d9000b00464f731e1bfsi2450270lfv.125.2022.05.02.05.06.27; Mon, 02 May 2022 05:06:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=RzU01DUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376458AbiD2N5F (ORCPT + 99 others); Fri, 29 Apr 2022 09:57:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376633AbiD2Nzw (ORCPT ); Fri, 29 Apr 2022 09:55:52 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECAC16E8C7; Fri, 29 Apr 2022 06:51:43 -0700 (PDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23TDmjEx024345; Fri, 29 Apr 2022 13:51:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=P0Afusgf9bfH6Ct37EAyWAKT/nUUPuuykzec1wMuPs8=; b=RzU01DUe1Q1tyYpKL7qLegrzmhZ/Gr75Tl80YWeFSwDyxhUp0dGi6eiGtWWW3eLp3NWk YgHP1hBoZhGvMyS0Rz7NqtCMww7jh8WJAAxAb0rVEZuHz1R3nlcIcOylAVaKexQTxsB4 56psZQFcF4g/MDHAXYKTUuAJahbJ2QteUv7z1R9tbVAt+aYQCEYsw9IZEcdL7JjtOHgL 20azOcYHas+XgvV43Tglv6OFHIrDr9QDIKz2gQueMgPh/itMXlkT3OyvilCQNB9iaAGb rBmO6YMwuc1RZFVa4YUuSvO2SUVPcAohmT03BLINU27kKeuwiOXITUlr+5ANh6fZULY3 Kw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqnke41vx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:39 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 23TDSCRQ016470; Fri, 29 Apr 2022 13:51:38 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqnke41ux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:38 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23TDRnL2027477; Fri, 29 Apr 2022 13:51:36 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04fra.de.ibm.com with ESMTP id 3fm938yan6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:36 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23TDpXpM39256566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Apr 2022 13:51:33 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B65EF4C040; Fri, 29 Apr 2022 13:51:33 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7649B4C04A; Fri, 29 Apr 2022 13:51:33 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 29 Apr 2022 13:51:33 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann , Bjorn Helgaas Subject: [RFC v2 24/39] PCI/sysfs: make I/O resource depend on HAS_IOPORT Date: Fri, 29 Apr 2022 15:50:39 +0200 Message-Id: <20220429135108.2781579-42-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220429135108.2781579-1-schnelle@linux.ibm.com> References: <20220429135108.2781579-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0ddSd3oA1l4sbZrqzBculXJaX5XvK_7N X-Proofpoint-GUID: t2bNXrpZdzc2_cw2OBvHefsBKhg8Rl7o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-29_06,2022-04-28_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=826 bulkscore=0 malwarescore=0 suspectscore=0 impostorscore=0 clxscore=1015 adultscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204290078 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Exporting I/O resources only makes sense if legacy I/O spaces are supported so conditionally add them only if HAS_IOPORT is set. Co-developed-by: Arnd Bergmann Signed-off-by: Niklas Schnelle --- drivers/pci/pci-sysfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index c263ffc5884a..eda258fa4981 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -1091,6 +1091,7 @@ static int pci_mmap_resource_wc(struct file *filp, struct kobject *kobj, return pci_mmap_resource(kobj, attr, vma, 1); } +#ifdef CONFIG_HAS_IOPORT static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count, bool write) @@ -1149,6 +1150,21 @@ static ssize_t pci_write_resource_io(struct file *filp, struct kobject *kobj, return pci_resource_io(filp, kobj, attr, buf, off, count, true); } +#else +static ssize_t pci_read_resource_io(struct file *filp, struct kobject *kobj, + struct bin_attribute *attr, char *buf, + loff_t off, size_t count) +{ + return -ENXIO; +} + +static ssize_t pci_write_resource_io(struct file *filp, struct kobject *kobj, + struct bin_attribute *attr, char *buf, + loff_t off, size_t count) +{ + return -ENXIO; +} +#endif /** * pci_remove_resource_files - cleanup resource files -- 2.32.0