Hi Michael, On Tue, Nov 17, 2015 at 12:33 AM, Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:
--- /dev/null +++ b/drivers/net/ethernet/8390/xsurf100.c @@ -0,0 +1,71 @@
+static int xsurf100_probe(struct zorro_dev *zdev, const struct zorro_device_id *ent) +{ + struct platform_device *pdev; + struct ax_plat_data ax88796_data; + struct resource res[2] = { + DEFINE_RES_IRQ(IRQ_AMIGA_PORTS), + DEFINE_RES_IO(zdev->resource.start + XS1000_8390_BASE, 4 * 0x20) + }; + int reg; + u32 reg_offsets[32]; + + for (reg = 0; reg < 0x20; reg++) + reg_offsets[reg] = 4; + + ax88796_data.flags = AXFLG_HAS_EEPROM; + ax88796_data.wordlength = 2; + ax88796_data.dcr_val = 0x48; + ax88796_data.rcr_val = 0x40; + ax88796_data.reg_offsets = reg_offsets; + + // TODO: xsurf100 specific accelerated data exchange + + pdev = platform_device_register_resndata( + &zdev->dev, "ax88796", zdev->slotaddr, + res, 2, + &ax88796_data, sizeof ax88796_data); + + // TODO: NULL check + zorro_set_drvdata(zdev, pdev);
This looks a bit strange to me: storing another platform device in the driver-specific data. But I guess it's valid ;-) BTW, as most Zorro boards are made of one or more "discrete" devices (e.g. an IDE and Ethernet combo), but only one zorro_driver can bind to it, I started converting Zorro drivers to MFD drivers a few years ago. Unfortunately I still haven't finished that. It would also make it simpler to embed a normal ax88796 platform device.
+ return 0; +}
+static struct zorro_device_id xsurf100_zorro_tbl[] = {
const
+ { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF100, }, + { 0 } +};
Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html