Explorar o código

[components][drivers][sdio]修复 SDIO product 为空的问题

tangyuxin %!s(int64=5) %!d(string=hai) anos
pai
achega
2f2933245e
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      components/drivers/sdio/sdio.c

+ 10 - 0
components/drivers/sdio/sdio.c

@@ -709,6 +709,16 @@ static rt_int32_t sdio_initialize_function(struct rt_mmcsd_card *card,
     if (ret)
         goto err1;
 
+    /*
+     * product/manufacturer id is optional for function CIS, so
+     * copy it from the card structure as needed.
+     */
+    if (func->product == 0)
+    {
+        func->manufacturer = card->cis.manufacturer;
+        func->product = card->cis.product;
+    }
+
     card->sdio_function[func_num] = func;
 
     return 0;