From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756606AbbCFT1e (ORCPT ); Fri, 6 Mar 2015 14:27:34 -0500 Received: from mail-qc0-f169.google.com ([209.85.216.169]:37848 "EHLO mail-qc0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754828AbbCFTZv (ORCPT ); Fri, 6 Mar 2015 14:25:51 -0500 From: Peter Hurley To: Greg Kroah-Hartman , Rob Herring , Grant Likely Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Hurley Subject: [PATCH v2 -next 11/14] of: earlycon: Allow multiple OF_EARLYCON_DECLARE() with same name Date: Fri, 6 Mar 2015 14:25:27 -0500 Message-Id: <1425669930-22137-12-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 2.3.1 In-Reply-To: <1425669930-22137-1-git-send-email-peter@hurleysoftware.com> References: <1425669930-22137-1-git-send-email-peter@hurleysoftware.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since matching is performed only on the compatible string, allow multiple declarations of OF_EARLYCON_DECLARE() with the same name. For example, OF_EARLYCON_DECLARE(omap8250, "ti,omap2-uart", early_omap8250_setup); OF_EARLYCON_DECLARE(omap8250, "ti,omap3-uart", early_omap8250_setup); OF_EARLYCON_DECLARE(omap8250, "ti,omap4-uart", early_omap8250_setup); Generate a unique identifier for each declaration in the current compilation unit. Signed-off-by: Peter Hurley --- include/linux/serial_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 675d36f..0a711a7 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -362,7 +362,7 @@ extern int of_setup_earlycon(const struct of_device_id *match, #endif #define OF_EARLYCON_DECLARE(_name, compat, fn) \ - static const struct of_device_id __of_table_##_name \ + static const struct of_device_id __UNIQUE_ID(_name) \ EARLYCON_OF_TABLE_ATTR \ = { .name = __stringify(_name), \ .compatible = compat, \ -- 2.3.1