1*25b6a6f1Skrish_iyer /* 2*25b6a6f1Skrish_iyer * Copyright 2018 Haiku, Inc. All rights reserved. 3*25b6a6f1Skrish_iyer * Distributed under the terms of the MIT License. 4*25b6a6f1Skrish_iyer * 5*25b6a6f1Skrish_iyer * Authors: 6*25b6a6f1Skrish_iyer * B Krishnan Iyer, krishnaniyer97@gmail.com 7*25b6a6f1Skrish_iyer */ 8*25b6a6f1Skrish_iyer #include "mmc_bus.h" 9*25b6a6f1Skrish_iyer 10*25b6a6f1Skrish_iyer 11*25b6a6f1Skrish_iyer MMCBus::MMCBus(device_node* node) 12*25b6a6f1Skrish_iyer : 13*25b6a6f1Skrish_iyer fNode(node), 14*25b6a6f1Skrish_iyer fController(NULL), 15*25b6a6f1Skrish_iyer fCookie(NULL), 16*25b6a6f1Skrish_iyer fStatus(B_OK), 17*25b6a6f1Skrish_iyer fDriverCookie(NULL) 18*25b6a6f1Skrish_iyer { 19*25b6a6f1Skrish_iyer CALLED(); 20*25b6a6f1Skrish_iyer device_node* parent = gDeviceManager->get_parent_node(node); 21*25b6a6f1Skrish_iyer fStatus = gDeviceManager->get_driver(parent, 22*25b6a6f1Skrish_iyer (driver_module_info**)&fController, &fCookie); 23*25b6a6f1Skrish_iyer gDeviceManager->put_node(parent); 24*25b6a6f1Skrish_iyer 25*25b6a6f1Skrish_iyer if (fStatus != B_OK) { 26*25b6a6f1Skrish_iyer ERROR("Not able to establish the bus %s\n", 27*25b6a6f1Skrish_iyer strerror(fStatus)); 28*25b6a6f1Skrish_iyer return; 29*25b6a6f1Skrish_iyer } 30*25b6a6f1Skrish_iyer } 31*25b6a6f1Skrish_iyer 32*25b6a6f1Skrish_iyer 33*25b6a6f1Skrish_iyer MMCBus::~MMCBus() 34*25b6a6f1Skrish_iyer { 35*25b6a6f1Skrish_iyer CALLED(); 36*25b6a6f1Skrish_iyer } 37*25b6a6f1Skrish_iyer 38*25b6a6f1Skrish_iyer 39*25b6a6f1Skrish_iyer status_t 40*25b6a6f1Skrish_iyer MMCBus::InitCheck() 41*25b6a6f1Skrish_iyer { 42*25b6a6f1Skrish_iyer return fStatus; 43*25b6a6f1Skrish_iyer } 44