Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3784869iob; Mon, 2 May 2022 05:46:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnkNIzv1MBQvUIv9WAp9iZ2zgVj1ljc2N3UgQYMdezZqJiIiEIaTy2Kogu3/C7h1rBz53n X-Received: by 2002:a63:580b:0:b0:3c1:a780:59f7 with SMTP id m11-20020a63580b000000b003c1a78059f7mr9487186pgb.76.1651495606238; Mon, 02 May 2022 05:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651495606; cv=none; d=google.com; s=arc-20160816; b=zE734KVAGIpGEKFrM9BcM++TYkUZ7M4HOXVN2gmUq2BxP+Bb4BfNWW8Mf1E03plDiu lrREjWxYxMupv4D2eI2VnlPHjphTk43lW2j/cwPNwAn0NAvjSOhlaMEYmuuqJxxA04fh 5I0FATuojqxspcxaimv9XCTSWNlFHJUCbM6M2ICskGlFeeoidhtYK7O9sC9HSqkgF2ho LB08wQb4lbrkh5GxXTXvGdyDsSXKKIMNJBwMX672EyHh3Id945LlxsBYdjI14YazRCtd WhQGudAZUD95iF7EpbOzQjq+MIYCIX2xO3AMwR8YwhkI1VCRRWVoLgLQmlsc2tnFhMMq C4vQ== 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=LjP47SC23t1dAjzphy0dZcj61Yu01BEpf46sLq9ewrklnmjb8lpsI+UnS2f7Zjdgmw Ezioge7U/R+DIQwuk9nYw6P6dnjktfqQ7dvB/HtK+JJ7fmLE+y6hAhgPTPlQCKCpeKe4 1m6yoIhDEoYoKp7abJT/5DRy76eniw7tnXJs4nI03x70n3vcpmY+3DdPv0cBTf9MYoK4 Vgg4bkkMQsKyaYdDf0Oek5xyxOiSO3hzy99ue8wlpjQjDsDEf1SWCuZth00PtegNByWV wI0o0l69s4EV0YCxgti3LocdRHSu2v8PdMKt8E9utqCRxo7gRYD6DdzgQ6FS54FdddJY woyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=lSksyNMd; 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 u18-20020a631412000000b003ab2603395esi13668766pgl.874.2022.05.02.05.46.28; Mon, 02 May 2022 05:46:46 -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=lSksyNMd; 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 S1376903AbiD2N6O (ORCPT + 99 others); Fri, 29 Apr 2022 09:58:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376738AbiD2N43 (ORCPT ); Fri, 29 Apr 2022 09:56:29 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E56ECE137; Fri, 29 Apr 2022 06:51:52 -0700 (PDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23TDh0Iv008359; Fri, 29 Apr 2022 13:51:48 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=lSksyNMdB5tE6nMzzYjAt3yNOib00N8anYeF/LuzR+Hzuf3J+/0oNJQsfQ29hmwnwZnu 7no5FrN1kQmpUpVjzYu9uOePVYAhnqNux/+H3g/upNY4m5qi1Kxn5fXJdezuKzIpw8M/ T6lBkyQHwGYnf+eycoDF6K0MrbG469jL1nNqk74nEE2OCrZkRrzvzhRql7nBMm9F96yA GpyAM86Y1Oy47do0bCe/reOJZQO0YaiPzPflg77iT+ZZvC6CMjFQ/s5FrUk1BGJppf81 GUMKSlnC0Vpop4yBDvhg+OuLtf5kEl2s6+DfTmjHyGQ1X2htoV6spEJA+P119gdnfbWe yg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3frh55r5y6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:48 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 23TDiaFu017618; Fri, 29 Apr 2022 13:51:47 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3frh55r5xe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:47 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23TDS5hj011971; Fri, 29 Apr 2022 13:51:45 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06fra.de.ibm.com with ESMTP id 3fm8qhqaw7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:45 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23TDphmJ53608914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Apr 2022 13:51:43 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 216FC4C046; Fri, 29 Apr 2022 13:51:43 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5E484C040; Fri, 29 Apr 2022 13:51:42 +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:42 +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: [PATCH 32/37] PCI/sysfs: make I/O resource depend on HAS_IOPORT Date: Fri, 29 Apr 2022 15:50:55 +0200 Message-Id: <20220429135108.2781579-58-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: yMHBYv3uDFu-sgmphHMqADnuWQMst-WM X-Proofpoint-GUID: DTiT1M9OQ1cffN7HabIl6uHWSu8EWt9V 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 spamscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 clxscore=1015 mlxlogscore=891 priorityscore=1501 suspectscore=0 impostorscore=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,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