X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fdrv%2Fpci.c;h=702c9ccc51eb7ab1d3b3096983fd18c68953795d;hb=4ebe00546574e97c5316881881f7f2562deea74b;hp=f09389bc4e7905560b144d36c8911a75587a63b6;hpb=bf62604f78c2d8bc88cac3664e15ed02c6e6d581;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/drv/pci.c b/KernelLand/Kernel/drv/pci.c index f09389bc..702c9ccc 100644 --- a/KernelLand/Kernel/drv/pci.c +++ b/KernelLand/Kernel/drv/pci.c @@ -33,7 +33,7 @@ typedef struct sPCIDevice int PCI_Install(char **Arguments); int PCI_ScanBus(int ID, int bFill); -char *PCI_int_ReadDirRoot(tVFS_Node *node, int pos); + int PCI_int_ReadDirRoot(tVFS_Node *node, int pos, char Dest[FILENAME_MAX]); tVFS_Node *PCI_int_FindDirRoot(tVFS_Node *node, const char *filename); Uint32 PCI_int_GetBusAddr(Uint16 Bus, Uint16 Slot, Uint16 Fcn, Uint8 Offset); size_t PCI_int_ReadDevice(tVFS_Node *node, off_t Offset, size_t Length, void *buffer); @@ -197,16 +197,16 @@ int PCI_ScanBus(int BusID, int bFill) /** * \brief Read from Root of PCI Driver */ -char *PCI_int_ReadDirRoot(tVFS_Node *Node, int Pos) +int PCI_int_ReadDirRoot(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]) { ENTER("pNode iPos", Node, Pos); if(Pos < 0 || Pos >= giPCI_DeviceCount) { - LEAVE('n'); - return NULL; + LEAVE_RET('i', -EINVAL); } - LEAVE('s', gPCI_Devices[Pos].Name); - return strdup( gPCI_Devices[Pos].Name ); + LOG("Name = %s", gPCI_Devices[Pos].Name); + strncpy(Dest, gPCI_Devices[Pos].Name, FILENAME_MAX); + LEAVE_RET('i', 0); } /** */