Re: [PATCH v5] ata/pata_buddha: Probe via modalias instead of initcall

Max Staudt
2019-08-20T15:59:47Z

Hi Bartlomiej,

Thank you very much for your review!

Question below.

On 08/20/2019 02:06 PM, Bartlomiej Zolnierkiewicz wrote:
>> + /* Workaround for X-Surf: Save drvdata in case zorro8390 has set it */
>> + old_drvdata = dev_get_drvdata(&z->dev);
>
> This should be done only for type == BOARD_XSURF.

Agreed, as I want to keep unloading functional for Buddha/Catweasel - see below.

>> +static struct zorro_driver pata_buddha_driver = {
>> + .name = "pata_buddha",
>> + .id_table = pata_buddha_zorro_tbl,
>> + .probe = pata_buddha_probe,
>> + .remove = pata_buddha_remove,
>
> I think that we should also add:
>
> .driver = {
> .suppress_bind_attrs = true,
> },
>
> to prevent the device from being unbinded (and thus ->remove called)
> from the driver using sysfs interface.

Interesting idea - here's my question now:

My intention is to allow remove() for boards where we support IDE only (Buddha, Catweasel) - these are autoprobed via zorro_register_driver().
This shouldn't affect the X-Surf case, as it's not autoprobed in this way anyway - and thus pata_buddha_driver isn't even used.

Am I missing something? We want to inhibit module unloading (hence no module_exit()), but driver unbinding for Buddha/Catweasel should be fine to remain, right?

> Please also always check your patches with scripts/checkpatch.pl and
> fix the reported issues:

Apologies, must've been something in my coffee. I will.

Thanks for the review, I'll send a new patch once my question above is resolved.

Max