es1370: initialize the log only if the hardware is detected

Otherwise the logfile always exists on all Haiku installs. There is
nothing useful logged to it if no hardware is found.

Change-Id: I290cb0ac070256dbd2647d5fe36ab71f825600e8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7578
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
PulkoMandy 2024-03-31 14:47:39 +02:00 committed by waddlesplash
parent 5c6e17e773
commit 723c4270dd
1 changed files with 6 additions and 10 deletions

View File

@ -385,21 +385,17 @@ init_hardware(void)
int ix=0;
pci_info info;
status_t err = ENODEV;
LOG_CREATE();
PRINT(("init_hardware()\n"));
if (get_module(pci_name, (module_info **)&pci))
return ENOSYS;
while ((*pci->get_nth_pci_info)(ix, &info) == B_OK) {
if (info.vendor_id == 0x1274
&& (info.device_id == 0x5000
/*|| info.device_id == 0x1371
|| info.device_id == 0x5880*/)
)
{
if (info.vendor_id == 0x1274 && (info.device_id == 0x5000
/*|| info.device_id == 0x1371 || info.device_id == 0x5880*/))
{
LOG_CREATE();
PRINT(("init_hardware()\n"));
err = B_OK;
}
ix++;