Do not introduce a new field in i2c_smbus class

master
Michal Malý 9 months ago
parent 23ec68701a
commit f5fc3ff450

@ -47,7 +47,10 @@ bool IsRecognizedI2CBus(i2c_smbus_interface* bus)
const char *name; const char *name;
while((name = RECOGNIZED_I2C_BUS_NAMES[idx++]) != nullptr) while((name = RECOGNIZED_I2C_BUS_NAMES[idx++]) != nullptr)
{ {
if (std::strcmp(name, bus->bus_name) == 0) return true; if(std::strcmp(name, bus->device_name) == 0)
{
return true;
}
} }
return false; return false;

@ -232,8 +232,7 @@ bool i2c_smbus_linux_detect()
} }
bus = new i2c_smbus_linux(); bus = new i2c_smbus_linux();
strcpy(bus->device_name, device_path); strcpy(bus->device_name, device_string);
strcpy(bus->bus_name, device_string);
bus->handle = test_fd; bus->handle = test_fd;
bus->pci_device = pci_device; bus->pci_device = pci_device;
bus->pci_vendor = pci_vendor; bus->pci_vendor = pci_vendor;

@ -130,7 +130,6 @@ i2c_smbus_amdadl::i2c_smbus_amdadl(ADL_CONTEXT_HANDLE context, int adapter_index
this->pci_subsystem_device = sbd_id; this->pci_subsystem_device = sbd_id;
this->port_id = 1; this->port_id = 1;
strcpy(this->device_name, "AMD ADL"); strcpy(this->device_name, "AMD ADL");
strcpy(this->bus_name, "AMD ADL");
} }
} }
} }

@ -77,7 +77,6 @@ class i2c_smbus_interface
{ {
public: public:
char device_name[512]; char device_name[512];
char bus_name[512];
int port_id; int port_id;
int pci_device; int pci_device;

Loading…
Cancel
Save