From patchwork Wed Apr 10 19:58:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 162040 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6605576jan; Wed, 10 Apr 2019 12:59:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlXYavsXMEJfZgaZ+cOV+VoQ6DOMmCE6wywxk9RNsfQCo2WZXdRwAjM51RLXTIVJOznObB X-Received: by 2002:a17:902:a01:: with SMTP id 1mr17282985plo.36.1554926351784; Wed, 10 Apr 2019 12:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554926351; cv=none; d=google.com; s=arc-20160816; b=HgDt6sdlWNUnsg31Wq5G82TVzSCKH+GBkf1hydg3SZom/T3yp42suQ7qUhsutMytov rvXSDgff+dXGcMCfH2HIvpIL9Q+sllAH+vP2Ln3QrdUM55wBLSQQ2iO6MHyr4eRIkiG5 v119fs2T9r/O5sQWOSfzdqeg/gpF74Nvqqaa8neBpRpxuATNtqYSLFM+WjythXbjmIqV G30wuRsyCa8TfzHvdxv4KIrWWv6mn5PogoYubOLDIWnz7cja/pDd6LOM2cPkENR+Qseh O5tKwpklyrQQv86M7Z+VZVDKX/WDAby0nrbxd/wBnO98F/OAdwYhUBQl/IjAtvKDvd7B +v1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xF0+W7srIQfbgQ7tlGxBCjWOJ+vLDr6qxPO28weJN5Y=; b=Yq3gdGhyqOspUHhFIylTdZgBge5z53EkKpLiT2q5s9JZiJiwc1dNXjfcaXN6DoI/zc IXycDhdcAqnWaLNKaQu/zJJSqUT/AwlIZJnpWH+kvXz35oK7Df9v+2LEq4jjSySBY6ak M1WFC2EzgSHlsnbZsOCeTwEEso/ZVEpqs59ZBhkxYFvO2IV3UPCb8EyOz503gKs0X8sh 3oeYaaN7HRHta+6/G4xjoDtuu29w/PiQJqPRblfONwUsdkAmClBrKD1tIvc4SExvgAhY 9L9CTC4HoBLTKUSdZsVrcw3FiSE7zc0DQnLfEk5bFUDxO5hc1MTSGeV6YezHwW2pj+rv Wsow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QP1vEQtQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si560749pgw.359.2019.04.10.12.59.11; Wed, 10 Apr 2019 12:59:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QP1vEQtQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbfDJT7K (ORCPT + 31 others); Wed, 10 Apr 2019 15:59:10 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37172 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbfDJT7J (ORCPT ); Wed, 10 Apr 2019 15:59:09 -0400 Received: by mail-lj1-f194.google.com with SMTP id v13so3297697ljk.4 for ; Wed, 10 Apr 2019 12:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xF0+W7srIQfbgQ7tlGxBCjWOJ+vLDr6qxPO28weJN5Y=; b=QP1vEQtQhoJSrpZ76JBL1JAYV+zoZbWvYwB5G5p18VhhzHZBR2lMnGBoqbyRvNr0pq 4OoUGdDwPBl3J8a4UO97fGmytDlID6KzSlRdoVCzR3SNnR+r4tTM1lV6ujfQlIlVagXK uO0tXtmSG5ptGpp7laRSeweAc9bxB01JqHArPISzXsGzTE4q+K5w/eqPKfGwWb69zOaX gDiMvuM1FKmmxSFyuvDUJ47R9sz05HNBltF4LNg8ZXPHCwcPF901ylscKJ4LzBbV2AAe q8vM9cBtGjbBPp/OCI9smkda/UjqT+FOWvKWjwnr2WlqKbtk9PLFzuACWKnaqjXY94Kz wKww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xF0+W7srIQfbgQ7tlGxBCjWOJ+vLDr6qxPO28weJN5Y=; b=pnTyfmjW+MfW0YuADltG5D99usrXUe36hz2FrD8qUzTTQ3v5Go6C3FCKcqlRcfu3rs /w7IUq58M4WVYe/t49DAnUxSvhjEdSA7xXS/8mhTePrdaTuT6xZsDzqi7Z4S1/L3wmt3 yFrG8hFDbKyAzaQmqzqofzb4KImqJvydURcs7c7IdnTzWJDdi3hkGorPv0Nuk+J6GSHR uYEvR39/Xcih9ot4eMuZhP4/N8aThcEQHvhpAZuKRC+NBwkDIwu0l53FDYjlFN00qYZy Nh7PZtgx7MdrvSom9iTwWlYk2ySe7JO9xlH/1ZETqtteUvoHP9HGcMyC+QgOm4/zdVWp q5dg== X-Gm-Message-State: APjAAAVkj87ssKV4xMyD74k+x2zCG3ATrbKJMfFsVJJwGi9CTPTXlpX4 fx4iKxORd1eAlUcHXC022gppyQ== X-Received: by 2002:a2e:968c:: with SMTP id q12mr23873796lji.36.1554926346965; Wed, 10 Apr 2019 12:59:06 -0700 (PDT) Received: from localhost (c-573670d5.07-21-73746f28.bbcust.telenor.se. [213.112.54.87]) by smtp.gmail.com with ESMTPSA id q5sm7150752lfm.16.2019.04.10.12.59.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Apr 2019 12:59:06 -0700 (PDT) From: Anders Roxell To: dwmw2@infradead.org, computersforpeace@gmail.com, bbrezillon@kernel.org, marek.vasut@gmail.com, richard@nod.at Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH 2/2] mtd: nand: raw: fix build dependency Date: Wed, 10 Apr 2019 21:58:52 +0200 Message-Id: <20190410195852.4066-2-anders.roxell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410195852.4066-1-anders.roxell@linaro.org> References: <20190410195852.4066-1-anders.roxell@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When enable CONFIG_MTD_NAND_ECC_SW_BCH as a module, the MTD_NAND_ECC_SW_BCH depends on MTD_NAND, but the module controlled by MTD_NAND links against the module controlled by MTD_NAND_ECC_SW_BCH. This leads to the following link failure. aarch64-linux-gnu-ld: drivers/mtd/nand/raw/nand_base.o: in function `nand_cleanup': ../drivers/mtd/nand/raw/nand_base.c:5886: undefined reference to `nand_bch_free' aarch64-linux-gnu-ld: ../drivers/mtd/nand/raw/nand_base.c:5886:(.text+0x9928): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `nand_bch_free' aarch64-linux-gnu-ld: drivers/mtd/nand/raw/nand_base.o: in function `nand_set_ecc_soft_ops': ../drivers/mtd/nand/raw/nand_base.c:5093: undefined reference to `nand_bch_calculate_ecc' aarch64-linux-gnu-ld: ../drivers/mtd/nand/raw/nand_base.c:5093:(.text+0xe914): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against undefined symbol `nand_bch_calculate_ecc' aarch64-linux-gnu-ld: ../drivers/mtd/nand/raw/nand_base.c:5093: undefined reference to `nand_bch_calculate_ecc' aarch64-linux-gnu-ld: ../drivers/mtd/nand/raw/nand_base.c:5094: undefined reference to `nand_bch_correct_data' aarch64-linux-gnu-ld: ../drivers/mtd/nand/raw/nand_base.c:5094:(.text+0xe934): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against undefined symbol `nand_bch_correct_data' aarch64-linux-gnu-ld: ../drivers/mtd/nand/raw/nand_base.c:5094: undefined reference to `nand_bch_correct_data' aarch64-linux-gnu-ld: ../drivers/mtd/nand/raw/nand_base.c:5148: undefined reference to `nand_bch_init' aarch64-linux-gnu-ld: ../drivers/mtd/nand/raw/nand_base.c:5148:(.text+0xebbc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `nand_bch_init' Rework CONFIG_MTD_NAND_ECC_SW_BCH from tristate to bool, and then link the nand_bch.o file into nand.ko if its enabled. Fixes: 51ef1d0b2095 ("mtd: nand: Clarify Kconfig entry for software BCH ECC algorithm") Signed-off-by: Anders Roxell --- drivers/mtd/nand/raw/Kconfig | 2 +- drivers/mtd/nand/raw/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index 615d738be411..0500c42f31cb 100644 --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -22,7 +22,7 @@ menuconfig MTD_RAW_NAND if MTD_RAW_NAND config MTD_NAND_ECC_SW_BCH - tristate "Support software BCH ECC" + bool "Support software BCH ECC" select BCH default n help diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile index 8bc6faaa3bc7..efaf5cd25edc 100644 --- a/drivers/mtd/nand/raw/Makefile +++ b/drivers/mtd/nand/raw/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_MTD_RAW_NAND) += nand.o obj-$(CONFIG_MTD_NAND_ECC_SW_HAMMING) += nand_ecc.o -obj-$(CONFIG_MTD_NAND_ECC_SW_BCH) += nand_bch.o +nand-$(CONFIG_MTD_NAND_ECC_SW_BCH) += nand_bch.o obj-$(CONFIG_MTD_SM_COMMON) += sm_common.o obj-$(CONFIG_MTD_NAND_CAFE) += cafe_nand.o