首页 > 其他分享 >platform_device_register和platform_device_register_full的区别

platform_device_register和platform_device_register_full的区别

时间:2023-08-23 20:34:40浏览次数:29  
标签:full register platform 注册 device 设备

platform_device_register和platform_device_register_full都是用于在Linux内核中注册平台设备的函数,但是它们之间存在一些区别。

  1. platform_device_register

platform_device_register函数用于注册一个平台设备。它接受一个指向platform_device结构体的指针作为参数,该结构体表示要注册的平台设备。该函数会将设备添加到平台设备列表中,以便与驱动程序进行匹配和加载。

原型:
int platform_device_register(struct platform_device *pdev);

返回值:
成功返回0,失败返回负值错误码。

  1. platform_device_register_full

platform_device_register_full函数也用于注册一个平台设备,但是它接受更多的参数,并且提供了更多的功能。它接受一个指向platform_device结构体的指针、一个设备初始化函数指针和一个资源结构体列表作为参数。

与platform_device_register相比,platform_device_register_full提供了更多的选项,例如可以指定设备的资源、设置设备的驱动程序信息和回调函数等。因此,它可以更灵活地注册设备并支持更多的功能。

原型:
int platform_device_register_full(struct platform_device *pdev, struct device_initdata *initdata, void *data);

返回值:
成功返回0,失败返回负值错误码。

总的来说,platform_device_register是更简单的注册函数,适用于基本的设备注册场景。而platform_device_register_full提供了更多的选项和功能,适用于需要更多定制的设备注册场景。

标签:full,register,platform,注册,device,设备
From: https://www.cnblogs.com/zhiminyu/p/17652714.html

相关文章

  • a start job is running for udev wait for complete device initialization
    astartjobisrunningforudevwaitforcompletedeviceinitializationreference:https://github.com/AdnanHodzic/displaylink-debian/issues/331diff/etc/init.d/systemd-udevd+systemctlmasksystemd-udev-settleudevadmtrigger--action=addudevadmsett......
  • Halcon 深度学习的例子错误set_deep_ocr_param (DeepOcrHandle, 'device', DLDevice)
    set_deep_ocr_param(DeepOcrHandle,'device',DLDevice)这句话报错设置的设备不对。解决办法是:注释掉这句代码在第27行代码:create_deep_ocr([],[],DeepOcrHandle)下面加上这句:set_suitable_device_in_ocr_handle(DeepOcrHandle)就可以解决问题。......
  • RCC registers / F411
    RCCclockcontrolregisterRCC_CRRCCclockcontrolregisterRCC时钟控制寄存器RCC_PLLCFGRRCCPLLconfigurationregisterPLL配置寄存器RCC_CFGRRCCclockconfigurationregister时钟配置寄存器RCC_CIRRCCclockinterruptregisterRCC时钟中断寄存器......
  • gitlab-runner register
    [root@g~]#gitlab-runnerregisterRuntimeplatformarch=amd64os=linuxpid=23614revision=ac8e767aversion=12.6.0Runninginsystem-mode.P......
  • torch._C._cuda_setDevice(device)
    1.问题原因:安装的事pytorchCPU版本;2解决办法:卸载已安装的pytorch,安装GPU版本的pytorch安装命令如下:pip3installtorchtorchaudio-ihttps://pypi.tuna.tsinghua.edu.cn/simple安装过程有点长,安装过程运行如下:安装完后验证是否安装成功:importtorchtorch.cuda.is_available()......
  • platform总线详解
    转载:手把手教Linux驱动10-platform总线详解-知乎(zhihu.com)platform总线是学习linux驱动必须要掌握的一个知识点。本文参考已发布:Linux3.14内核一、概念嵌入式系统中有很多的物理总线:I2c、SPI、USB、uart、PCIE、APB、AHBlinux从2.6起就加入了一套新的驱动管理和注册的......
  • Auto-registering all your components in Vue 3 with Vite
    Auto-registeringallyourcomponentsinVue3withVite#vue#vitejs#componentsWhyauto-registercomponents?I'mactuallyabigfanofmanuallyimportingcomponentsinVueapplications.Itmakesitveryclearwhereeverycomponentcomesfrom,does......
  • 本地启动 ABAP Platform Trial 的 Docker 命令行程序
    Docker是一个开源的容器化平台,用于轻松地构建、发布和运行应用程序。DockerDesktop是适用于Windows和Mac的Docker桌面应用程序,它允许用户在本地运行和管理容器化应用程序。在本文中,我们将详细介绍以下两个命令行并解释每个参数的含义:dockerpullsapse/abap-platform-trial:190......
  • 支持本地部署,完全免费的 ABAP 来了 - ABAP Platform Trial 1909 发布
    我曾经编写过一套零基础的ABAP编程学习教程,截至2023年8月2日,总共包含114篇文章:零基础快速学习ABAP有零基础自学ABAP的朋友咨询,如果手头没有ABAP开发环境该怎么办?我在2019年时写过一篇文章,提到了SAP云平台上免费的ABAP编程环境:ABAP开发者上云的时候到了-......
  • 合宙ESP32C3使用PlatformIO开发点亮ST7735S
    开发背景模块使用的合宙的ESP32-C3(经典款)购买连接COREESP32核心板是基于乐鑫ESP32-C3进行设计的一款核心板,尺寸仅有21mm*51mm,板边采用邮票孔设计,方便开发者在不同场景下的使用。核心板支持UART、GPIO、SPI、I2C、ADC、PWM等接口,可根据实际需要选择。屏幕使用的LuatOS屏......