[PATCH 4.10 001/167] MIPS: pic32mzda: Fix linker error for pic32_get_pbclk()

From: Greg Kroah-Hartman
Date: Fri Mar 10 2017 - 04:27:13 EST


4.10-stable review patch. If anyone has any objections, please let me know.

------------------

From: Purna Chandra Mandal <purna.mandal@xxxxxxxxxxxxx>

commit a726f1d2dd4fee179aa4513176d688ad309de6cc upstream.

Early clock API pic32_get_pbclk() is defined in early_clk.c and used by
time.c and early_console.c. When CONFIG_EARLY_PRINTK isn't set,
early_clk.c isn't compiled and time.c fails to link.

Fix it by compiling early_clk.c always. Also sort files in alphabetical
order.

Fixes: 6e4ad1b41360 ("MIPS: pic32mzda: fix getting timer clock rate.")
Reported-by: Harvey Hunt <harvey.hunt@xxxxxxxxxx>
Signed-off-by: Purna Chandra Mandal <purna.mandal@xxxxxxxxxxxxx>
Reviewed-by: Harvey Hunt <harvey.hunt@xxxxxxxxxx>
Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
Cc: Joshua Henderson <digitalpeer@xxxxxxxxxxxxxxx>
Cc: linux-mips@xxxxxxxxxxxxxx
Patchwork: https://patchwork.linux-mips.org/patch/13383/
Signed-off-by: James Hogan <james.hogan@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
arch/mips/pic32/pic32mzda/Makefile | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

--- a/arch/mips/pic32/pic32mzda/Makefile
+++ b/arch/mips/pic32/pic32mzda/Makefile
@@ -2,8 +2,7 @@
# Joshua Henderson, <joshua.henderson@xxxxxxxxxxxxx>
# Copyright (C) 2015 Microchip Technology, Inc. All rights reserved.
#
-obj-y := init.o time.o config.o
+obj-y := config.o early_clk.o init.o time.o

obj-$(CONFIG_EARLY_PRINTK) += early_console.o \
- early_pin.o \
- early_clk.o
+ early_pin.o