From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936111AbcIROfo (ORCPT ); Sun, 18 Sep 2016 10:35:44 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36039 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934380AbcIROff (ORCPT ); Sun, 18 Sep 2016 10:35:35 -0400 Date: Sun, 18 Sep 2016 16:35:29 +0200 From: Richard Cochran To: Nicolas Pitre Cc: Josh Triplett , John Stultz , Thomas Gleixner , lkml Subject: Re: [PATCH v3) posix-timers: make it configurable Message-ID: <20160918143529.GA4651@localhost.localdomain> References: <20160915210724.GB4245@localhost.localdomain> <20160915211555.GA16992@cloud> <20160915215649.GA17171@cloud> <20160916072421.GA14160@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 16, 2016 at 10:57:58PM -0400, Nicolas Pitre wrote: > Subject: [PATCH] ptp_clock: allow for it to be optional > > In order to break the hard dependency between the PTP clock subsystem and > ethernet drivers capable of being clock providers, this patch provides > simple PTP stub functions to allow linkage of those drivers into the > kernel even when the PTP subsystem is configured out. > > And to make it possible for PTP to be configured out, the select statement > in the Kconfig entry for those ethernet drivers is changed from selecting > PTP_1588_CLOCK to PTP_1588_CLOCK_DEFAULT whose purpose is to indicate the > default Kconfig value for the PTP subsystem. > > This way the PTP subsystem may have Kconfig dependencies of its own, such > as POSIX_TIMERS, without making those ethernet drivers unavailable if > POSIX timers are cconfigured out. And when support for POSIX timers is > selected again then PTP clock support will also be selected accordingly. > > Drivers must be ready to accept NULL from ptp_clock_register(). > The pch_gbe driver is a bit special as it relies on extra code in > drivers/ptp/ptp_pch.c. Therefore we let the make process descend into > drivers/ptp/ even if PTP_1588_CLOCK is unselected. Thanks for the detailed description. > diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig > index 00e6098e9a..c36c018f0f 100644 > --- a/drivers/ptp/Kconfig > +++ b/drivers/ptp/Kconfig > @@ -4,8 +4,12 @@ > > menu "PTP clock support" > > +config PTP_1588_CLOCK_DEFAULT > + tristate I see what this option is doing, but I wonder about the name "DEFAULT". In what sense is this a default? > +/** > + * 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. Here we should finally explain the return value for authors of new drivers. Something like this: * 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. > + */ > + > +extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, > + struct device *parent); Thanks, Richard