Received: by 10.223.176.5 with SMTP id f5csp2813457wra; Mon, 29 Jan 2018 04:31:00 -0800 (PST) X-Google-Smtp-Source: AH8x227AWGmgw4hIPSPqXpJFb6QA1B0nJ6eNmCT5gLxixiInkZKtg0XP2yMtF2OhFOEArTbfzg3K X-Received: by 2002:a17:902:8546:: with SMTP id d6-v6mr6221122plo.147.1517229060865; Mon, 29 Jan 2018 04:31:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517229060; cv=none; d=google.com; s=arc-20160816; b=YtTBh6Zcls28aP5lA39MYJ6fzs7RD83eqx3ldjnqzJoEMYWd9zzsq6QqtgY12LwirE SGQ8eCChfWpvL3JQ9LR5bpyM6zytqcIMbmxutnqOZgY1v9t6G82hVhbsgdDx/fwBQsKJ 1ZzUoBOpcb05s0MfENCQ7xM6fiuo7jGJqZen30Y3fWI7Q25mFbJXgYA0wR30r3pH+DiA U5x8jTlAo2z073T0EOikutcVMeeSwIs9k+indu/quqAOspZuUkotMvMnC8vUjA21uEMX zfOW1NZyFvMB3OVYtocmDziFbJdBEwO3U/VVmu0dy58o1tV/MV+GrbuDkXkTjxn6FpNJ UcMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=5Z8/nRPe8MFNWaCcbVItzMuksnBP/9M889yTiMQ0DTc=; b=hHh4Ffu/nKf0l0y/XmzexqtOWtT3xtEyVydcKt8SzURTAPFxV38K4SvlrIzhTLeNx2 PDZI6xbxkVoB1pyD/d9jSZIILnntO4SRm4DkDjzwL6+21xNeks913GX4ntvPd4IoBDy7 sxDSuoNKVacp3LfMGNJnMKS2ZSeawO2D8mBKctqTpJoFaNkUTK/REGhGRqWyUQ6x6R7e nwExhm960MYrHF0iVMhyVfHjdeEI7ZoFTKXqXOpq0ZcJ0SdwWKQbNz19S0uZYwfYCKhA 6hyjyOKlyXWL8xgcq47Fg2WB1pL+5vmVmEBCKi701pndAddZEFbTchJs5AJW2vgyNhlo 2QZQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1-v6si9189695pld.42.2018.01.29.04.30.46; Mon, 29 Jan 2018 04:31:00 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751810AbeA2MaZ (ORCPT + 99 others); Mon, 29 Jan 2018 07:30:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:42394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751369AbeA2MaY (ORCPT ); Mon, 29 Jan 2018 07:30:24 -0500 Received: from saruman (jahogan.plus.com [212.159.75.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 119E120C48; Mon, 29 Jan 2018 12:30:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 119E120C48 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jhogan@kernel.org Date: Mon, 29 Jan 2018 12:30:19 +0000 From: James Hogan To: Matt Redfearn Cc: Ralf Baechle , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS Message-ID: <20180129123018.GB7637@saruman> References: <1517225205-10374-1-git-send-email-matt.redfearn@mips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1517225205-10374-1-git-send-email-matt.redfearn@mips.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 29, 2018 at 11:26:45AM +0000, Matt Redfearn wrote: > When commit b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support") > added board support for the RBTX4939, it added a call to > led_classdev_register even if the LED class is built as a module. > Built-in arch code cannot call module code directly like this. Commit > b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro") subsequently > changed the inclusion of this code to a single check that > CONFIG_LEDS_CLASS is either builtin or a module, but the same issue > remains. > This leads to MIPS allmodconfig builds failing when CONFIG_MACH_TX49XX=y > is set: > > arch/mips/txx9/rbtx4939/setup.o: In function `rbtx4939_led_probe': > setup.c:(.init.text+0xc0): undefined reference to `of_led_classdev_register' > make: *** [Makefile:999: vmlinux] Error 1 > > Fix this by using the IS_BUILTIN() macro instead. > > Fixes: b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support") > Fixes: b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro") Well, I don't think the latter did anything wrong or made anything worse, so shouldn't really be implicated by "Fixes:", but other than that it looks like a reasonable workaround (even if ideally the driverlet would be separate from the device instantiation): Reviewed-by: James Hogan Thanks James > > Signed-off-by: Matt Redfearn > > --- > > arch/mips/txx9/rbtx4939/setup.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c > index 8b937300fb7f..fd26fadc8617 100644 > --- a/arch/mips/txx9/rbtx4939/setup.c > +++ b/arch/mips/txx9/rbtx4939/setup.c > @@ -186,7 +186,7 @@ static void __init rbtx4939_update_ioc_pen(void) > > #define RBTX4939_MAX_7SEGLEDS 8 > > -#if IS_ENABLED(CONFIG_LEDS_CLASS) > +#if IS_BUILTIN(CONFIG_LEDS_CLASS) > static u8 led_val[RBTX4939_MAX_7SEGLEDS]; > struct rbtx4939_led_data { > struct led_classdev cdev; > @@ -261,7 +261,7 @@ static inline void rbtx4939_led_setup(void) > > static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val) > { > -#if IS_ENABLED(CONFIG_LEDS_CLASS) > +#if IS_BUILTIN(CONFIG_LEDS_CLASS) > unsigned long flags; > local_irq_save(flags); > /* bit7: reserved for LED class */ > -- > 2.7.4 >