Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1324582pxy; Fri, 23 Apr 2021 05:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMoiTtPkOufvxB1I/e+qojStqM+2seuS/16fE4dysTK4Kpo8HLiLhXQ9r1dRGljUZ5E8OM X-Received: by 2002:a63:4e43:: with SMTP id o3mr3579691pgl.22.1619181776003; Fri, 23 Apr 2021 05:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619181775; cv=none; d=google.com; s=arc-20160816; b=p+C6GyKJSMnCRgx1g7RANYg+24sGb8QXNumjs7QyjTJ775uiLLTr8N0uTa5+eY+xFf FqAJzxtqJqzomBId9Z6+YGDEfR9QWISyLzLJNn6LPjCIVw4H58khMvjtkhQGkAxpEqxR PGhb+gQEwIWIB/TO/0X26mzBKGk8UI8DUFJLEeshcEZ7h9KF1H5JLfD8veEiNwvY9bhr imJmkuXbr5uCkJliPktEH+Bt+tgWctUwMCZQEGEMhQBSjfovnxec+N46HURp2XluX4bJ BBcJ5Aok+VMOoDWU9DZ/C2EumnIJCNQnq9/nerrhW5YQhvsUfRRgUJ5VmYIH4RVkLifV TRcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=qlJLGj8ehrYFh97of7liJeXRVH1Z6odJ8j8nozYSNxY=; b=ddrp0S1k9pByt2oCYFXSi57IKRNlgD5kan48QBCzUxF8LFSOW4+dJoLlDThx3EPd0k H2MSj/57n46EhalyTDEh89KntL8d1kxYzaRWJQ8D3+QC/sN6x9GCwNg6kCu0v8gfwMkO 8Rd7CIjZGLF8sxPMBzozPdLUJXUTlCUsKJrgrwLguBvDX1CvBvbtE9x/nIA2YcDsk+b2 5elKNo7LweGqifCnQLT54lrxPpPz2NkFdjHcykKEmdDFefKfNgMxl+H3si5TVBziRj3Y ZbtqsMQg+6Sd3jcd/ed9r8P7wSXNi0VZVjkqN2t4NEZbEq8XrTRRBPZUWBMm2no54WRX JVLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l132si8401679pfd.116.2021.04.23.05.42.43; Fri, 23 Apr 2021 05:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242302AbhDWMmq (ORCPT + 99 others); Fri, 23 Apr 2021 08:42:46 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:37902 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbhDWMmp (ORCPT ); Fri, 23 Apr 2021 08:42:45 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lZv8H-000eQR-55; Fri, 23 Apr 2021 14:42:05 +0200 Date: Fri, 23 Apr 2021 14:42:05 +0200 From: Andrew Lunn To: Ansuel Smith Cc: Florian Fainelli , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/14] drivers: net: dsa: qca8k: add support for qca8327 switch Message-ID: References: <20210423014741.11858-1-ansuelsmth@gmail.com> <20210423014741.11858-6-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210423014741.11858-6-ansuelsmth@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -1467,11 +1468,16 @@ qca8k_sw_probe(struct mdio_device *mdiodev) > gpiod_set_value_cansleep(priv->reset_gpio, 0); > } > > + /* get the switches ID from the compatible */ > + data = of_device_get_match_data(&mdiodev->dev); > + if (!data) > + return -ENODEV; > + > /* read the switches ID register */ > id = qca8k_read(priv, QCA8K_REG_MASK_CTRL); > id >>= QCA8K_MASK_CTRL_ID_S; > id &= QCA8K_MASK_CTRL_ID_M; > - if (id != QCA8K_ID_QCA8337) > + if (id != data->id) > return -ENODEV; It is useful to print an error message here: Found X, expected Y. Gives the DT writer an idea what they did wrong. Andrew