Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / pinctrl / pinconf-generic.c
index 3d9a999..29ff77f 100644 (file)
@@ -166,6 +166,7 @@ static struct pinconf_generic_dt_params dt_params[] = {
        { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 },
        { "input-schmitt-disable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 0 },
        { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 },
+       { "power-source", PIN_CONFIG_POWER_SOURCE, 0 },
        { "low-power-enable", PIN_CONFIG_LOW_POWER_MODE, 1 },
        { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 },
        { "output-low", PIN_CONFIG_OUTPUT, 0, },
@@ -228,13 +229,12 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
         * Now limit the number of configs to the real number of
         * found properties.
         */
-       *configs = kzalloc(ncfg * sizeof(unsigned long), GFP_KERNEL);
+       *configs = kmemdup(cfg, ncfg * sizeof(unsigned long), GFP_KERNEL);
        if (!*configs) {
                ret = -ENOMEM;
                goto out;
        }
 
-       memcpy(*configs, cfg, ncfg * sizeof(unsigned long));
        *nconfigs = ncfg;
 
 out: