Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp563749pxb; Thu, 12 Nov 2020 10:22:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiRG4oPZku2Xl/+AzTQMUIo4c/ZOI5TIIzNe/D3q+uOznAkJDThcjsw59IC59ut2bNWfIW X-Received: by 2002:a17:906:6a84:: with SMTP id p4mr600239ejr.270.1605205336031; Thu, 12 Nov 2020 10:22:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605205336; cv=none; d=google.com; s=arc-20160816; b=lJxSQHluwVjVi1vTx3tAhHzBA3OmCEvMbsss1sREkwc7KaYWt3/sXA7AgPNkWW1B5A UafiIvdEph66arH96jnf8yHdDkXZrqavAlO0mejrHPd/nCm/jsWH/HC9OH9gZsIi9Z9m YnwSgN82uL4N8Xlhrv907mm+vCOljor1felTC9aKLZRvCJiSnt7/19LdqRXk9LzYZtfn h9w3U+ncAr4dHYvAskFoUGdBq8nLfc458/hbGu2irlLsqF7goBCNd7jA/l/mcdm4jkOZ MywYhpWdRGT9ichTjhmi23m11h6AhEg1UbWVyGBax3ij2lXtfcU0vnvkOFDRoapdn/LL 7ytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=n7g1gNiWNUoiOnTmGN2ApE9IfRXIw3myaShl47KJKcQ=; b=GbrJiK+PFuq7rEYmIXq/WNPHtYR6F4RSb4/iDTLmBUx+rGSetbiw4xLkoDt1GZRyf4 6UeGYIB1KSNEKYmtjF/ek1oBAH6/lj+YP3MFLAN4CRNdfI6alZyrt+K+XVEA5a4VJEmf xeKdopHNRjMTZC5irCjKCpKDzjmTfYX7clx27VXcKv6rPQ7Y0GCGNXt8KmYYh9XPhept sZZSYqKq7RF6lTNRuq/9y4Nl4AZcNzSvYr/mdJoFjWMhq271N7x/HEJKJkP/8S9shmQT FSjEbGmSTwwlDI1w6MUi5vJVGqzr3/ut5pNb350zEal0NLeIuTCw9jeGzF7iHwKpAFl1 A6+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kJnc+FEG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x70si5018736ede.609.2020.11.12.10.21.51; Thu, 12 Nov 2020 10:22:16 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kJnc+FEG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726522AbgKLST6 (ORCPT + 99 others); Thu, 12 Nov 2020 13:19:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbgKLST6 (ORCPT ); Thu, 12 Nov 2020 13:19:58 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4362FC0613D1; Thu, 12 Nov 2020 10:19:58 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id 34so1610661pgp.10; Thu, 12 Nov 2020 10:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=n7g1gNiWNUoiOnTmGN2ApE9IfRXIw3myaShl47KJKcQ=; b=kJnc+FEG/l4y8Napsm/X9/qjqvCMpN4vmUqqRFGL0KIjULmi6J5JWxQ7fJd2a/F1pu 35Jn3Wd5EMd2KfRBPB7Tni7AYnhQqSXZpECGgNn2pZL9CKDn6drTTpb+lvKyHzpfdgBs e21MDX98i4B4ufrH+M3JcOBxx01BdL6bdIYAfEGlp87Y5uMRRNEshp6W2byJ12X+ibQt QRb4O1dSR2vDj/wNu9xFAjT4mIHtWp66DRJyJI9GOZtEWOpMQEzXkO9W+7J0gh+ZI8wT qEka8Jz2/E2cfnlAvDkdlDaLeEIa5hBcBUbsjksFGH1NxZ2eKdgB0FFKEQcrc9TxNBtg 77Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=n7g1gNiWNUoiOnTmGN2ApE9IfRXIw3myaShl47KJKcQ=; b=FT2BY1iAUc9OG6s/oI5CufRhwPChf7bcGe3H7huf0s35tb6CWwsSzKRReh78SpDVUH YLFnUOdXTqdaoOUkw5B2Dr43gyzqk3D954hb0gl/VBa1E62NNELuALS49cSe2ksL6/5k C7wTwgxIecuK0AVccUm9TL0Er0jziFHhXfbuuIs8DpanJk4UkH+jpKMPWGYQfxB16DiH dlOCB90SNTXekunu/98sFE2eyDz85fKOY4yEOfoiSRhwLaNj86RUa2X5v9wn5PQZ1MPi f1jRkNJx9EcrOu2gVkSlwCQ1ZXuyA73xpr8EycnKvr8D/NB5wLVuPs1bueGRP3+UBh6W kqMA== X-Gm-Message-State: AOAM533zpWQrXWTbhxFziHEzweZ1JOK8+5QWO43t7x+DSkOENZqmbOVZ DQ9uHru6Yii1IUstRETjOJM= X-Received: by 2002:a62:7ccd:0:b029:18b:9083:ae1b with SMTP id x196-20020a627ccd0000b029018b9083ae1bmr658078pfc.27.1605205197831; Thu, 12 Nov 2020 10:19:57 -0800 (PST) Received: from hoboy.vegasvil.org (c-73-241-114-122.hsd1.ca.comcast.net. [73.241.114.122]) by smtp.gmail.com with ESMTPSA id 144sm7236849pfb.71.2020.11.12.10.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 10:19:57 -0800 (PST) Date: Thu, 12 Nov 2020 10:19:54 -0800 From: Richard Cochran To: Arnd Bergmann Cc: =?utf-8?B?546L5pOO?= , Jakub Kicinski , Grygorii Strashko , "David S. Miller" , Samuel Zou , Kurt Kanzenbach , Ivan Khoronzhuk , Networking , "linux-kernel@vger.kernel.org" Subject: Re: Re: [PATCH V4 net-bugfixs] net/ethernet: Update ret when ptp_clock is ERROR Message-ID: <20201112181954.GD21010@hoboy.vegasvil.org> References: <20201111080027.7830f756@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 09:25:12AM +0100, Arnd Bergmann wrote: > This is not really getting any better. If Richard is worried about > Kconfig getting changed here, I would suggest handling the > case of PTP being disabled by returning an error early on in the > function, like > > struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs, > struct device_node *node) > { > struct am65_cpts *cpts; > int ret, i; > > if (!IS_ENABLED(CONFIG_PTP_1588_CLOCK)) > return -ENODEV; No, please, no. That only adds confusion. The NULL return value already signals that the compile time support was missing. That was the entire point of this... * ptp_clock_register() - register a PTP hardware clock driver * * @info: Structure describing the new clock. * @parent: Pointer to the parent device of the new clock. * * Returns a valid pointer on success or PTR_ERR on failure. If PHC * support is missing at the configuration level, this function * returns NULL, and drivers are expected to gracefully handle that * case separately. Thanks, Richard