Skip to content

Commit e4d6c4b

Browse files
rubinigregkh
authored andcommitted
FMC: support carriers with no mezzanine
At registration and unregistration time, I was checking fmc->flags for FMC_DEVICE_NO_MEZZANINE, to skip initialization and cleanup for empty slots. The check was wrong ("==" instead of "&") but registration failed anyways (as expected) because we had no EEPROM. This commit fixes one such checks and removes the other, so to actually accept slots with no mezzanines. That's because the carrier may offer some support anyways (the SPEC does), and working on the carrier with no mezzanine-specific driver is common during development. Signed-off-by: Alessandro Rubini <[email protected]> Acked-by: Juan David Gonzalez Cobas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 08d2d00 commit e4d6c4b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/fmc/fmc-core.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ int fmc_device_register_n(struct fmc_device **devs, int n)
154154
ret = -EINVAL;
155155
break;
156156
}
157-
if (fmc->flags == FMC_DEVICE_NO_MEZZANINE) {
157+
if (fmc->flags & FMC_DEVICE_NO_MEZZANINE) {
158158
dev_info(fmc->hwdev, "absent mezzanine in slot %d\n",
159159
fmc->slot_id);
160160
continue;
@@ -189,9 +189,6 @@ int fmc_device_register_n(struct fmc_device **devs, int n)
189189
for (i = 0; i < n; i++) {
190190
fmc = devarray[i];
191191

192-
if (fmc->flags == FMC_DEVICE_NO_MEZZANINE)
193-
continue; /* dev_info already done above */
194-
195192
fmc->nr_slots = n; /* each slot must know how many are there */
196193
fmc->devarray = devarray;
197194

@@ -263,8 +260,6 @@ void fmc_device_unregister_n(struct fmc_device **devs, int n)
263260
kfree(devs[0]->devarray);
264261

265262
for (i = 0; i < n; i++) {
266-
if (devs[i]->flags == FMC_DEVICE_NO_MEZZANINE)
267-
continue;
268263
sysfs_remove_bin_file(&devs[i]->dev.kobj, &fmc_eeprom_attr);
269264
device_del(&devs[i]->dev);
270265
fmc_free_id_info(devs[i]);

0 commit comments

Comments
 (0)