提交 ee8b9d28 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 ec58f307
...@@ -226,7 +226,7 @@ The following uses **rtc_hi35xx.c** as an example to present the information req ...@@ -226,7 +226,7 @@ The following uses **rtc_hi35xx.c** as an example to present the information req
// Prerequisite for conversion between HdfDeviceObject and RtcHost. // Prerequisite for conversion between HdfDeviceObject and RtcHost.
... ...
device->service = &host->service; // Prerequisite for conversion between HdfDeviceObject and RtcHost. device->service = &host->service; // Prerequisite for conversion between HdfDeviceObject and RtcHost.
// It allows the global use of host by calling RtcHostFromDevice. // It helps implement the global host by calling RtcHostFromDevice.
return HDF_SUCCESS; return HDF_SUCCESS;
} }
``` ```
...@@ -252,11 +252,11 @@ The following uses **rtc_hi35xx.c** as an example to present the information req ...@@ -252,11 +252,11 @@ The following uses **rtc_hi35xx.c** as an example to present the information req
struct RtcHost *host = NULL; struct RtcHost *host = NULL;
struct RtcConfigInfo *rtcInfo = NULL; struct RtcConfigInfo *rtcInfo = NULL;
... ...
host = RtcHostFromDevice(device);// A forced conversion from HdfDeviceObject to RtcHost is involved. host = RtcHostFromDevice(device);// Forcibly convert HdfDeviceObject to RtcHost.
rtcInfo = OsalMemCalloc(sizeof(*rtcInfo)); rtcInfo = OsalMemCalloc(sizeof(*rtcInfo));
... ...
// HiRtcConfigData reads attributes from the device configuration tree and fills the values in supportAnaCtrl, supportLock, spiBaseAddr, regAddrLength, and irq in rtcInfo. // HiRtcConfigData reads attributes from the device configuration tree and fills the values in supportAnaCtrl, supportLock, spiBaseAddr, regAddrLength, and irq in rtcInfo.
// Provide parameters for HiRtcSwInit and HiRtcSwInit, and perform operations such as releasing memory when the function internal processing fails. // Provide parameters for HiRtcSwInit and HiRtcSwInit. When HiRtcSwInit and HiRtcSwInit fail to be executed internally, Release() can be called to release memory.
if (HiRtcConfigData(rtcInfo, device->property) != 0) { if (HiRtcConfigData(rtcInfo, device->property) != 0) {
... ...
} }
...@@ -294,8 +294,8 @@ The following uses **rtc_hi35xx.c** as an example to present the information req ...@@ -294,8 +294,8 @@ The following uses **rtc_hi35xx.c** as an example to present the information req
struct RtcHost *host = NULL; struct RtcHost *host = NULL;
struct RtcConfigInfo *rtcInfo = NULL; struct RtcConfigInfo *rtcInfo = NULL;
... ...
host = RtcHostFromDevice(device); // A forced conversion from HdfDeviceObject to RtcHost is involved. host = RtcHostFromDevice(device); // Forcibly convert HdfDeviceObject to RtcHost.
rtcInfo = (struct RtcConfigInfo *)host->data;// A forced conversion from RtcHost to RtcConfigInfo is involved. rtcInfo = (struct RtcConfigInfo *)host->data;// Forcibly convert RtcHost to RtcConfigInfo.
if (rtcInfo != NULL) { if (rtcInfo != NULL) {
HiRtcSwExit(rtcInfo); HiRtcSwExit(rtcInfo);
OsalMemFree(rtcInfo); // Release RtcConfigInfo. OsalMemFree(rtcInfo); // Release RtcConfigInfo.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册