Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1683671

Re: [PATCH v1 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From "Kuppuswamy, Sathyanarayanan" <sathyaosid@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v1 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case
Date Sun, 09 Jul 2017 01:10:02 +0200
Message-ID <u171o-8py-9@gated-at.bofh.it> (permalink)
References <u0Jip-1sx-1@gated-at.bofh.it> <u171o-8py-11@gated-at.bofh.it>
X-Original-To Peter Rosin <peda@axentia.se>, sathyanarayanan.kuppuswamy@linux.intel.com
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=YKTqD+WnyvhjGXyufDmv3xYIW6ywN8jxYXiJ2ib/UUw=; b=iquJFBttixAzRD2N0php9EgB+xraWwCDCiMF71KPVHKZUtNfJPp8DW00IGkdSIC8Tf 1B+M/K06cOXxfyPutj8DknAtvW+M/+rcXM3tlVxjhYMDp7PAtZqsGIUqQfNEoMQZzmzf HYGAECX8m7qqAjoJesfrAnLjPMhhpR6AIhSW1kCiYsjfn08MAtcprZYDfLUvCakd3OFp 6wdLql4czeXdMvb381PsbhQPUbGhBuy9ECvV8sZEok/MvYCZVQ+fLNr9biQUfQVa+LsG zlwHoYUzDkl0NfE5mlpuOeUdYl6CXWkULEKtt5YjbHH/jB1ZzCg2RNjNk6w9Jdi01eEc /2BA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=YKTqD+WnyvhjGXyufDmv3xYIW6ywN8jxYXiJ2ib/UUw=; b=VW8d10Tgmb9NKtbHRZSmRSRyQhHtosSABcQ7Pf2Ss9OCwqgdciV4kRBxcsnB5eZfpq 36lAeLMpS8mjqTVpMGHtHSlQsE2pxS3fSZ4vRY2SHhUUsvBCuw/EUqRiU7ncTRwtyJFR msgJvTPRp6fKRQw8eXrZPSoMoouV+s1GJNgwmyKy6pZB5yazi22B9rqYx5un2ACA1Eo0 LDWe5sOavwtnjprQ24dhkENSfjGDUJMO76wwKhMZbU9fHNbieIPdFpmBg1HmC4yIYdU0 JP52wPkptWr65t0KN8d7RfKJERABxXaP2em/044U682jtMluTXhgKFRN17WyP+5zlK2H NsLw==
X-Gm-Message-State AIVw1115EA1miQ/iMHjdX/w57NMIuWKl/dt1xxgev9FgH/osZrwnyJEZ bFHCO6Kpo9MhyZPuHDk=
X-Received by 10.84.215.140 with SMTP id l12mr10595630pli.133.1499555072960; Sat, 08 Jul 2017 16:04:32 -0700 (PDT)
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
Content-Language en-US
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 84
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org
X-Original-Date Sat, 8 Jul 2017 16:04:30 -0700
X-Original-Message-ID <1bd098de-312e-d75e-0089-93848c12481c@gmail.com>
X-Original-References <b401a6875042aa54f739403605ecaf30c9997aeb.1499463614.git.sathyanarayanan.kuppuswamy@linux.intel.com> <fe9f5e79-a415-e880-feb3-3a4eaa4ae4cb@axentia.se>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1683671

Show key headers only | View raw


Hi Peter,

On 7/8/2017 1:55 PM, Peter Rosin wrote:
> On 2017-07-07 23:41, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> Add dummy functions to avoid compile time issues when CONFIG_MULTIPLEXER
>> is not enabled.
> Hi!
>
> Consumers should "select MULTIPLEXER",
  If their driver can't work without mux_* calls then  you can make it 
compulsory. But its not always true.
>   so this does not make sense.
> Or do you have a driver that has an optional mux consumer?
I came across this case when I was working on Intel USB MUX driver. I 
think you know the history behind it. Although I am not planning to 
merge that driver now, but I think the use case is still valid.
>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>> ---
>>   include/linux/mux/consumer.h | 38 ++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 38 insertions(+)
>>
>> diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h
>> index 5577e1b..744a5b8 100644
>> --- a/include/linux/mux/consumer.h
>> +++ b/include/linux/mux/consumer.h
>> @@ -16,6 +16,7 @@
>>   struct device;
>>   struct mux_control;
>>   
>> +#ifdef CONFIG_MULTIPLEXER
>>   unsigned int mux_control_states(struct mux_control *mux);
>>   int __must_check mux_control_select(struct mux_control *mux,
>>   				    unsigned int state);
>> @@ -29,4 +30,41 @@ void mux_control_put(struct mux_control *mux);
>>   struct mux_control *devm_mux_control_get(struct device *dev,
>>   					 const char *mux_name);
>>   
>> +#else
>> +unsigned int mux_control_states(struct mux_control *mux)
> static inline
>
> Cheers,
> peda
>
>> +{
>> +	return -ENODEV;
>> +}
>> +
>> +int __must_check mux_control_select(struct mux_control *mux,
>> +				    unsigned int state)
>> +{
>> +	return -ENODEV;
>> +}
>> +
>> +int __must_check mux_control_try_select(struct mux_control *mux,
>> +					unsigned int state)
>> +{
>> +	return -ENODEV;
>> +}
>> +
>> +int mux_control_deselect(struct mux_control *mux)
>> +{
>> +	return -ENODEV;
>> +}
>> +
>> +struct mux_control *mux_control_get(struct device *dev, const char *mux_name)
>> +{
>> +	return ERR_PTR(-ENODEV);
>> +}
>> +
>> +void mux_control_put(struct mux_control *mux) {}
>> +
>> +struct mux_control *devm_mux_control_get(struct device *dev,
>> +					 const char *mux_name)
>> +{
>> +	return ERR_PTR(-ENODEV);
>> +}
>> +#endif
>> +
>>   #endif /* _LINUX_MUX_CONSUMER_H */
>>

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v1 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case sathyanarayanan.kuppuswamy@linux.intel.com - 2017-07-07 23:50 +0200
  Re: [PATCH v1 1/1] mux: consumer: Add dummy functions for  !CONFIG_MULTIPLEXER case "Kuppuswamy, Sathyanarayanan" <sathyaosid@gmail.com> - 2017-07-09 01:10 +0200

csiph-web