Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3171156ybi; Mon, 29 Jul 2019 02:08:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2MhPjr0I1FjHFotPpoa1boVpbSlTRVI5ma2PdxMKw6Uhmvhx8bFjUEdRf7x0DcgliF0yc X-Received: by 2002:a17:90a:9a83:: with SMTP id e3mr108888143pjp.105.1564391287239; Mon, 29 Jul 2019 02:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564391287; cv=none; d=google.com; s=arc-20160816; b=kQdhOyt1BYPHhrtVRLx9x3fST6i/g/DijSnS0njkeASbq8CN65md6TTuD/CMCGKXPg BpWaH5gZlcYWUvRHub4NcRLUc/9iA3aMY2yNfNF3k8C1deAJELdmntqJxdDx5jluDSOL 0YsHt13aXV/Y8MSSnRF7lFFMQh00XQShI4D3dGcsrL+7JjZLOMcfSjDNecESrxn9Za5v 0da75OR/z55qFcMk7YakYLUG2ijh6Xm/4fNAR2aZBtqoRyasQFOapQ7VAEJu5w/Ofzpj PRlMwEWvvUS9oOIcJ5fkNWn0M15PSfkGTgKir+dX+IBlHu6WaBVXZoJyHS85nVygCuSw Q+bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=gYEJAxjcgTtQm2cZf+kuqC8244eoV04/bbKoaP0JwWQ=; b=Xpeip5y9zQE8EU5HYi21vZu8QQb0qQUZ5uZOHmGW4W2OM0O0Ye9UYJG5ksjg61ewcs ZmGNEV/BQMYuAK71arAOeNLaN7/7qm8ZgVesmKY0ty0/iIFDx+zKpE3yRMC7tEGmdaVd RLx0/elng0HJaS7OpQ4/CKiM3Pe8w4RpiRzSu/7PPIAHWFtodEDy9vNPpfIqBJ1a9fHV tpgVKx2oXCLJkM48Z+vlXQ8EjuMbFJNWDZB9JD8fTwoKfh1sX4CvFNtr9nuv3+z3lVlj NdfoKDCJ9hTViNP0DtZT8bW6AAr9yauqlwX/JyJ7mJrgfyfA+vagpJwGtwtlyyn5nm7c 6kCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si27630916pgd.455.2019.07.29.02.07.51; Mon, 29 Jul 2019 02:08:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727038AbfG2IxV (ORCPT + 99 others); Mon, 29 Jul 2019 04:53:21 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38228 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbfG2IxV (ORCPT ); Mon, 29 Jul 2019 04:53:21 -0400 Received: by mail-wr1-f65.google.com with SMTP id g17so60881839wrr.5; Mon, 29 Jul 2019 01:53:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gYEJAxjcgTtQm2cZf+kuqC8244eoV04/bbKoaP0JwWQ=; b=hrKT5Ot/r7j4G30s4V9YYNaBuGxXYNQQ3g6LL2i+YOjZNg6pgpPgi+9aNJDDy2f3Kn fT8IRvocwDjv3zPiKap+N7DlLmzIBuJWJ7u5MBTUWFM3e1sOxTJ+ptxjr0lVOIYkITAH KuUNUJ76ibu/Em0nF6t0vIMXguAfa+TPBVxhi7Xoupam9ZR7AJO9tOA09709Egzzg5It g0/JiHXUBoQpltlevOxAzYe9SEa1c7l47w1DtxPEXON/uW9yqyhPU5UHrZ2dN4pL8KlQ trMiQJh3fd1hiJdWnJJ+UD75dQdHd9yIWN69PadGqhr2BlLZOlsNEJV3wox8Kd8O0l7U JCmQ== X-Gm-Message-State: APjAAAV93uT9FLai778aVqN8CI7B9UYsa+g9ZAozfypX823xVcvZL7y+ 8PZDpIEijVfNAaC2uBUaxdsxnAQ8nbV2zZ99hTZUYM53 X-Received: by 2002:a5d:630c:: with SMTP id i12mr31091883wru.312.1564390398844; Mon, 29 Jul 2019 01:53:18 -0700 (PDT) MIME-Version: 1.0 References: <20190725102211.8526-1-max@enpas.org> In-Reply-To: <20190725102211.8526-1-max@enpas.org> From: Geert Uytterhoeven Date: Mon, 29 Jul 2019 10:53:07 +0200 Message-ID: Subject: Re: [PATCH v2] ata/pata_buddha: Probe via modalias instead of initcall To: Max Staudt Cc: linux-ide@vger.kernel.org, "Linux/m68k" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Max, On Thu, Jul 25, 2019 at 3:25 PM Max Staudt wrote: > Up until now, the pata_buddha driver would only check for cards on > initcall time. Now, the kernel will call its probe function as soon > as a compatible card is detected. > > Device removal remains unimplemented. A WARN_ONCE() serves as a > reminder. > > v2: Rename 'zdev' to 'z' to make the patch easy to analyse with > git diff --ignore-space-change > > Tested-by: Max Staudt > Signed-off-by: Max Staudt Thanks for your patch! > --- a/drivers/ata/pata_buddha.c > +++ b/drivers/ata/pata_buddha.c > @@ -145,111 +146,162 @@ static struct ata_port_operations pata_xsurf_ops = { > .set_mode = pata_buddha_set_mode, > }; > > -static int __init pata_buddha_init_one(void) > +static int pata_buddha_probe(struct zorro_dev *z, > + const struct zorro_device_id *ent) > { [...] > + switch (z->id) { > + case ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA: > + default: > + type = BOARD_BUDDHA; > + break; > + case ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL: > + type = BOARD_CATWEASEL; > + nr_ports++; > + break; > + case ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF: > + type = BOARD_XSURF; > + break; > + } Please obtain the type from ent->driver_data instead of using a switch() statement... > -module_init(pata_buddha_init_one); > +static const struct zorro_device_id pata_buddha_zorro_tbl[] = { > + { ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA, }, > + { ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL, }, > + { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, }, ... after storing it in zorro_device_id.driver_data here. > + { 0 } > +}; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org 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