arcotg_udc: exports duplicate symbol imx_usb_create_charger (owned by kernel)

Posted zengjf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了arcotg_udc: exports duplicate symbol imx_usb_create_charger (owned by kernel)相关的知识,希望对你有一定的参考价值。

/*********************************************************************************
 * arcotg_udc: exports duplicate symbol imx_usb_create_charger (owned by kernel)
 * 说明:
 *     内核驱动中到处的函数和模块中导出的函数重复了。
 *
 *                                              2017-10-14 深圳 南山平山村 曾剑锋
 ********************************************************************************/


一、错误信息:
    [[email protected] ~]#  modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber
    ="buildroot"
    arcotg_udc: exports duplicate symbol imx_usb_create_charger (owned by kernel)
    modprobe: cant load module arcotg_udc (kernel/drivers/usb/gadget/arcotg_udc.ko): invalid module format
    [[email protected] ~]#

二、查找imx_usb_create_charger函数:
    [email protected]:~/kernel/linuxQt_kernel$ grep imx_usb_create_charger * -R
    Binary file drivers/usb/gadget/arcotg_udc.o matches
    Binary file drivers/usb/gadget/arcotg_udc.ko matches
    drivers/usb/gadget/arcotg_udc.c:    if (imx_usb_create_charger(&udc_controller->charger, "imx_usb_charger"))
    drivers/usb/gadget/imx_usb_charger.c: * imx_usb_create_charger - create a USB charger
    drivers/usb/gadget/imx_usb_charger.c:int imx_usb_create_charger(struct usb_charger *charger,
    drivers/usb/gadget/imx_usb_charger.c:EXPORT_SYMBOL(imx_usb_create_charger);
    Module.symvers:0xa8003a03    imx_usb_create_charger    drivers/usb/gadget/arcotg_udc    EXPORT_SYMBOL
    [email protected]:~/kernel/linuxQt_kernel$

三、cat drivers/usb/gadget/imx_usb_charger.c
    ...
    int imx_usb_create_charger(struct usb_charger *charger,
            const char *name)
    {
        int         ret = 0;
        struct power_supply *psy = &charger->psy;
    
        if (!charger->dev)
            return -EINVAL;
    
        if (name)
            psy->name = name;
        else
            psy->name = "usb_charger";
    
        usb_charger_init(charger);
    
        psy->type       = POWER_SUPPLY_TYPE_USB;
        psy->properties     = power_props;
        psy->num_properties = ARRAY_SIZE(power_props);
        psy->get_property   = usb_charger_get_property;
    
        psy->supplied_to    = usb_charger_supplied_to;
        psy->num_supplicants    = sizeof(usb_charger_supplied_to)/sizeof(char *);
        psy->external_power_changed = my_batt_ext_power_changed;
    
        ret = power_supply_register(charger->dev, psy);
        if (ret)
            goto fail;
    
        mutex_init(&charger->lock);
        INIT_WORK(&charger->work, usb_charger_work);
    
    fail:
        return ret;
    }
    EXPORT_SYMBOL(imx_usb_create_charger);
    ...

四、cat drivers/usb/gadget/arcotg_udc.c
    ...
        /* create usb charger */
    #ifdef CONFIG_IMX_USB_CHARGER
        udc_controller->charger.dev = &pdev->dev;
        udc_controller->charger.dp_pullup = usb_charger_pullup_dp;
        udc_controller->charger.enable = true;
        if (pdata->charger_base_addr)
            udc_controller->charger.charger_base_addr = pdata->charger_base_addr;
        if (imx_usb_create_charger(&udc_controller->charger, "imx_usb_charger"))
            dev_err(&pdev->dev, "Can‘t create usb charger\n");
    #else
        udc_controller->charger.dp_pullup = usb_charger_pullup_dp;
        udc_controller->charger.enable = false;
    #endif
    ...

五、解决办法:
    make menuconfig去掉CONFIG_IMX_USB_CHARGER

 

以上是关于arcotg_udc: exports duplicate symbol imx_usb_create_charger (owned by kernel)的主要内容,如果未能解决你的问题,请参考以下文章

连接不同形状的数组

Docker 之 基本安装配置

awk 特定文本并在上面打印 2 行

更新 gspread 以获取 duplicate_sheet [重复]

module.exports和exports export和export default

module.exports,exports,export和export default,import与require区别与联系