Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2769417rwd; Mon, 22 May 2023 04:13:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6p+Pl5N22VgWjZsZLT7TwHo3JfkIc41ye1U5KbfhEg8cuTfZWtuhNuzUlLjFyBK7+NCTY/ X-Received: by 2002:a05:6a21:99a4:b0:10c:2cb7:29b1 with SMTP id ve36-20020a056a2199a400b0010c2cb729b1mr244922pzb.51.1684753990101; Mon, 22 May 2023 04:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684753990; cv=none; d=google.com; s=arc-20160816; b=KOXxIiThKBYYjwb3vspP4lUT8MylBHOKuZeD7tLDmTzG0qFZ8kLN5UMJ9cr6TqF570 vVtLbopjsiaNQ6eIuuqu5DFkKS8FoSCsYnPzqIkKufWlvinqMr4D08xniwawf0D7Ih0j PlGZVo59/rvMbs7xy++/AloZuqTnbX2qV4C/RYiOIsF7F3m8GMaM0bmfGdtI4GA7j5Cz G8Pa1xiHhkAxMeJC4fuEOwbq7AFTGEYmOM6xExz7UqAA0mCKwojJCX9THEl7PQapsUsW EttKcz+EENjDA+APoeO4vIysumK+l3BM3NcjP3iniD7fycX4V8oWKtVSmMWPFN5IAbyo DKtQ== 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=0d35dVy07doASwqwzRpS+hS1Pq6btefcGFAPHwNl90Y=; b=y5jXVqH0vzriSh8yetgJ0n0KQtfyGeDBdz4rdUszLl3TjFskhF+L74hz16jZV+VcwL 9b0hGjT7JU8rlpk9/n4amLp+w3E15g4/QZm5KL13Htkaot9CcaJHVuz6mlliF9qNVmS9 Um+CCw2foz//jJIiGWtRyL5NylB1805e35BcFlI7lxD8fNi+a84/G9GP/oge9WTDE5K2 qWTBjlaAYFIlbb90N2s71idtyx4KaIA5I9a52+Ht9rJB8QaV0PKb3Ij55uG/9S2II6id Kvtb1Nb7VLMLRw7iFLA0b85tf/z0QYfR+o4PHt6FmvdG7lJSvZ7wb4oJYN3Sysr0N5jT 2e3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=cVL3WOtm; 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=REJECT 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 w19-20020a63af13000000b00534253c0576si4404787pge.535.2023.05.22.04.12.55; Mon, 22 May 2023 04:13:10 -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=cVL3WOtm; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232994AbjEVKwJ (ORCPT + 99 others); Mon, 22 May 2023 06:52:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232893AbjEVKvk (ORCPT ); Mon, 22 May 2023 06:51:40 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D998DE0; Mon, 22 May 2023 03:51:21 -0700 (PDT) Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34M9MDjB012787; Mon, 22 May 2023 10:51:11 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=0d35dVy07doASwqwzRpS+hS1Pq6btefcGFAPHwNl90Y=; b=cVL3WOtmaj34oA/TkRZikX6bAYg2S6I2Om0xg0AFWKOq6Uxur0qPPbvsA/fH+pw4KMgD c52tKjuBOG+JUnQXbCthO79ZIxwzxrz9dOH9d/2ecDhLVqEcv/QPioAlD7e3toO3HkAx sT/OoK9YIHknYyFLMEzsNs/zx7k7+eFcwNq6MUOzkFcEWKG9tB+NqUlTHvnoNWeKCBcw HutC2b/R/daGkp73kMWBluxcMnDVWF3dxd/2IHoR7t5wV+PpMA9+wEYL9b8G2EDzmSvV htoJYUQ+bSDCP5TlH7rRF8raf1ClSNuNkoQIWbcIxiwqnH4M2+2dtgP+AfFFQTgQIKGg Ow== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqfq39qu8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:10 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34MAmBle030370; Mon, 22 May 2023 10:51:10 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqfq39qt9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:10 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34M4qk06021874; Mon, 22 May 2023 10:51:08 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3qppcu8wex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:08 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34MAp57i37356182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2023 10:51:05 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A937D2004B; Mon, 22 May 2023 10:51:05 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5AFD320040; Mon, 22 May 2023 10:51:05 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 22 May 2023 10:51:05 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann , Greg Kroah-Hartman Cc: Bjorn Helgaas , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Mauro Carvalho Chehab , Alan Stern , "Rafael J. Wysocki" , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann Subject: [PATCH v5 19/44] misc: add HAS_IOPORT dependencies Date: Mon, 22 May 2023 12:50:24 +0200 Message-Id: <20230522105049.1467313-20-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522105049.1467313-1-schnelle@linux.ibm.com> References: <20230522105049.1467313-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: iUY3ZgieaQVLeuAply_hJ0HHVVv35hXw X-Proofpoint-GUID: 6DT80NBISlgIiM0IXH3HoOpgDib2ttMy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-22_06,2023-05-22_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 impostorscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305220089 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, T_SCC_BODY_TEXT_LINE 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 In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle --- drivers/misc/altera-stapl/Makefile | 3 ++- drivers/misc/altera-stapl/altera.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/misc/altera-stapl/Makefile b/drivers/misc/altera-stapl/Makefile index dd0f8189666b..90f18e7bf9b0 100644 --- a/drivers/misc/altera-stapl/Makefile +++ b/drivers/misc/altera-stapl/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -altera-stapl-objs = altera-lpt.o altera-jtag.o altera-comp.o altera.o +altera-stapl-y = altera-jtag.o altera-comp.o altera.o +altera-stapl-$(CONFIG_HAS_IOPORT) += altera-lpt.o obj-$(CONFIG_ALTERA_STAPL) += altera-stapl.o diff --git a/drivers/misc/altera-stapl/altera.c b/drivers/misc/altera-stapl/altera.c index a58b7cb81d98..587427b73914 100644 --- a/drivers/misc/altera-stapl/altera.c +++ b/drivers/misc/altera-stapl/altera.c @@ -2407,6 +2407,10 @@ int altera_init(struct altera_config *config, const struct firmware *fw) astate->config = config; if (!astate->config->jtag_io) { + if (!IS_ENABLED(CONFIG_HAS_IOPORT)) { + retval = -ENODEV; + goto free_state; + } dprintk("%s: using byteblaster!\n", __func__); astate->config->jtag_io = netup_jtag_io_lpt; } @@ -2481,7 +2485,7 @@ int altera_init(struct altera_config *config, const struct firmware *fw) } else if (exec_result) printk(KERN_ERR "%s: error %d\n", __func__, exec_result); - +free_state: kfree(astate); free_value: kfree(value); -- 2.39.2