Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3217010imu; Sat, 24 Nov 2018 00:19:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/W7SLHyZA9w4fpRe16/QMYeXbWxE7SNh4K5lHSpvlKhKl+TY29q431DbJOWZ7RcooBEIEJB X-Received: by 2002:a63:181c:: with SMTP id y28mr16700105pgl.75.1543047594954; Sat, 24 Nov 2018 00:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543047594; cv=none; d=google.com; s=arc-20160816; b=u8FhqyaXxHRA/ULXlCH60rLttVWfCdWyo+VAdRdyEv3Qf4GnaZPS/9PqkFAP6kdU/f OO8T+gNFtO+pw+/ohtnRcMlg9qptFl6eYA8iPFkwr0tbJI487GHGPsDtJw6IkgOatOzY /a5Nh9nwW9oJLJNSdZiEx24hGrDVhpi4eoVp8ZHenAPfCG1jrS0RTZhCjbkP08YjnlyM 36SOnJamiokncAeij12xS510CUDlSd91PWm1NMx1MAyjTAJXTx40hmq96h6oJOvdLCkf rY+Haz+q9AwuL5COmTgOrKRJwUsOZ4dwH11C3fk+l21cGv2O8H1pLoBH2je3cGqcY0px Uchg== 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=any4FmYY/LdNJ7dv+5oFEsPFV8qJ+56k6WaJQexK4eM=; b=AD13g9SaI7ogp06fHmLXM4IrnA2M8MoL380xGWifoBrUkzCVqwaMg2jO5uVVRIG1An wds1XoXuQSeSrY0T1iAe0p0JWRuDp0u6YQ1ftDts4r//n99reWMmDDK2J/wA76cThKN3 CX5Qy9A1KmL4GtR0ewXxW1fWyA4iqrc2ioJWpdTd+AtXpCHPI7SAdAyrQPp57qteHwH5 RGHLuA1dm7ZOBs70TP6n/3o1ZVDX6A7+POMXvmxmePdvOzmepY5akyG0QJAGM3hdp9lc NnGQZlvYQZRpPMKHk6B2xbOqp4/W+rysWnwooo2UqSgxOlWxvE0ABhcJPIwZ3RruNlq5 5VcQ== 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 f4si8572363pgg.492.2018.11.24.00.19.40; Sat, 24 Nov 2018 00:19:54 -0800 (PST) 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 S2409161AbeKWUYj (ORCPT + 99 others); Fri, 23 Nov 2018 15:24:39 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:38346 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390381AbeKWUYj (ORCPT ); Fri, 23 Nov 2018 15:24:39 -0500 Received: by mail-vs1-f67.google.com with SMTP id x64so6825660vsa.5; Fri, 23 Nov 2018 01:41:08 -0800 (PST) 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=any4FmYY/LdNJ7dv+5oFEsPFV8qJ+56k6WaJQexK4eM=; b=CipdJNnKbJhKrkPNcyQKShnp6v41ePsnewO62Eod5I2pW0qRRtH3LeHhHdXV+biq5B XiyV13UHVie8rjEBB6oSQyMOlmvea0oCCJOK/4Cd9ALuF/Iv6B+Xvo8lHfE8J/0qgJRS TczljCzhbABrxzLI+eP+0UUBnjuObZbTrzDvskVwLZZ370BCPdT360nETFNdQCRM1NOE MIsdQOHm/kWdD0roz9lXW3msPRaSsdVnZK0BcFpqS7TSvmUPzBKec27dunxkSwIDakv6 opCQ5uE/v/pRmGKvfitmfz9EB6b+g9vtyqFJbfF+O/mHX0icIoL25Cu1/qPHT9YyjVmF W5qw== X-Gm-Message-State: AGRZ1gJjRU0pm4usyDTsmJOoFlK4RlswtxKsDPoqE4UfxyHTe6vNEqPM bdmnqJWWA8RqycO4T4MXjJZelX3+EkhuYhwZVSs= X-Received: by 2002:a67:3885:: with SMTP id n5mr5537835vsi.96.1542966068343; Fri, 23 Nov 2018 01:41:08 -0800 (PST) MIME-Version: 1.0 References: <20181119161838.10610-1-phil.edworthy@renesas.com> In-Reply-To: <20181119161838.10610-1-phil.edworthy@renesas.com> From: Geert Uytterhoeven Date: Fri, 23 Nov 2018 10:40:56 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: rzn1: Fix check for used MDIO bus To: Phil Edworthy Cc: Jacopo Mondi , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Linux-Renesas 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 Phil, Thanks for your patch! On Mon, Nov 19, 2018 at 5:18 PM Phil Edworthy wrote: > This fixes the check for unused mdio bus setting and the following static > checker warning: > drivers/pinctrl/pinctrl-rzn1.c:198 rzn1_pinctrl_mdio_select() > warn: always true condition '(ipctl->mdio_func[mdio] >= 0) => (0-u32max >= 0)' > > It also fixes the return var when calling of_get_child_count() I think this should be a separate patch. > Reported-by: Dan Carpenter > Signed-off-by: Phil Edworthy Reviewed-by: Geert Uytterhoeven BTW, I have a question about rzn1_pinctrl_mdio_select(): static void rzn1_pinctrl_mdio_select(struct rzn1_pinctrl *ipctl, int mdio, u32 func) { if (ipctl->mdio_func[mdio] >= 0 && ipctl->mdio_func[mdio] != func) dev_warn(ipctl->dev, "conflicting setting for mdio%d!\n", mdio); ipctl->mdio_func[mdio] = func; dev_dbg(ipctl->dev, "setting mdio%d to %u\n", mdio, func); writel(func, &ipctl->lev2->l2_mdio[mdio]); } The check warns the user if it overrides an already initialized MDIO function with a different value. However, there is no method to uninitialize (reset to -1) mdio_func[], to avoid getting the warning. For a use case, I was thinking about a DT overlay that would cause the MDIO function to be initialized on loading, and needs to uninitialize the MDIO function on removing. Perhaps that is very unlikely or even impossible, given the function of the pins controlled by the MDIO function? Thanks! 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