]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
GPIO: pca953x: Rework to not include commands in SPL
authorTom Rini <trini@konsulko.com>
Wed, 3 Jan 2018 14:23:14 +0000 (09:23 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 19 Jan 2018 20:49:29 +0000 (15:49 -0500)
The command portion of the GPIO driver can only be used in full SPL so
re-work to guard the command related portions and mark it as static.

Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/gpio/pca953x.c

index d1c1ae141125e468a20ba30f5c31ecdcebcaf4be..10a105df94ab22005eb10ff768e5c9ee0c342ea4 100644 (file)
@@ -142,7 +142,7 @@ int pca953x_get_val(uint8_t chip)
        return (int)val;
 }
 
-#ifdef CONFIG_CMD_PCA953X
+#if defined(CONFIG_CMD_PCA953X) && !defined(CONFIG_SPL_BUILD)
 /*
  * Display pca953x information
  */
@@ -193,7 +193,7 @@ static int pca953x_info(uint8_t chip)
        return 0;
 }
 
-cmd_tbl_t cmd_pca953x[] = {
+static cmd_tbl_t cmd_pca953x[] = {
        U_BOOT_CMD_MKENT(device, 3, 0, (void *)PCA953X_CMD_DEVICE, "", ""),
        U_BOOT_CMD_MKENT(output, 4, 0, (void *)PCA953X_CMD_OUTPUT, "", ""),
        U_BOOT_CMD_MKENT(input, 3, 0, (void *)PCA953X_CMD_INPUT, "", ""),
@@ -201,7 +201,7 @@ cmd_tbl_t cmd_pca953x[] = {
        U_BOOT_CMD_MKENT(info, 2, 0, (void *)PCA953X_CMD_INFO, "", ""),
 };
 
-int do_pca953x(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_pca953x(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        static uint8_t chip = CONFIG_SYS_I2C_PCA953X_ADDR;
        int ret = CMD_RET_USAGE, val;