From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63C58C43334 for ; Fri, 1 Jul 2022 20:06:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229971AbiGAUGm (ORCPT ); Fri, 1 Jul 2022 16:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbiGAUGl (ORCPT ); Fri, 1 Jul 2022 16:06:41 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EE2B45505; Fri, 1 Jul 2022 13:06:41 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id v185so5811463ybe.8; Fri, 01 Jul 2022 13:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mmR8iUUwPvvGa3qQx8YQJ+SVKO3sq39Az7PLcxuZz3A=; b=oY05/wttYxGli/gCgXA2u18vdKojjR8sSMqUIKrFDsJQgTnMZb9ZFCjIOov+/xPw0O BLvk2Hw/Rf0aJ6CLpX3SEDQojPG1VYqPBHhY6HvlaWxBUgDdXUry2qapteRg/HmeU5+u 0Cnz8nfclK+NSm0dRaDw8e7crDQ8vVyw9Tpyu9w+KKKVx8Ymyrns1nhxdn05lEMZK2MA XPvhCY7flL6vF3yDEtS6D8o5lHExK6dl3rOLds+EPVY3Gf2jsrV6MygdgQp8/N/DWJq9 Ro5jJOw2jB+oRxI+VLfC47JIZhDlrNmC3nyQF0P1nF3aCT2sFy4orCjsxxqDfBoOogJz ccCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mmR8iUUwPvvGa3qQx8YQJ+SVKO3sq39Az7PLcxuZz3A=; b=lFLEoHeSbkUp4MHbN7O7WNnDzWSYNsS6ex3sTZuEHut/EPvMzyxiCMEvk6bHNbE6QY UgNeh6VbbOa07aa0aLHy61SxFWIvfzhbkpS3SiL+/hh+iLabRsxDz5y9ZQOTab+C0HSm cWiEHJq4u/sUwR82UsYIvnGFaaf51EwNy4SZE7tkU5RELD3ScHZVlZ/bbwBFP1dXYRDK vAfHkuFPswE0Tt8vY54BNl+TDHSTUUi+Z0Vr4fcB7MgpH8jPDvG2PC07rtbmiJRXSDQC Xh0ThQSc5nrJ90cPWJtZYM6oXQzUG8cD2hIXcGaQx9EuNkqwRO1ad8S4j85y9yqWloD9 xD5A== X-Gm-Message-State: AJIora+gI/Rnkwg4ZNTqCMmt2zNm0RSXKXjhJP0bab9ETAA4pNQsTHa0 hdPHe2nNBQPhpIWgKtYZH9RWMfUzcLZE0AHNIvEObir7DXr9dhCn X-Google-Smtp-Source: AGRyM1tmbSsGff7AGFP4d/BpQmef7a+vmYTOkolqSckN06zSGysXK009G4NGKGvyDgzwacFwpWobPEEG40Gs13Q4h+4= X-Received: by 2002:a25:ca0a:0:b0:66b:4e6c:e094 with SMTP id a10-20020a25ca0a000000b0066b4e6ce094mr18394272ybg.296.1656706000179; Fri, 01 Jul 2022 13:06:40 -0700 (PDT) MIME-Version: 1.0 References: <20220629143046.213584-1-aidanmacdonald.0x0@gmail.com> <20220629143046.213584-13-aidanmacdonald.0x0@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Fri, 1 Jul 2022 22:06:03 +0200 Message-ID: Subject: Re: [PATCH v4 12/15] pinctrl: Add AXP192 pin control driver To: Aidan MacDonald Cc: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jonathan Cameron , Sebastian Reichel , Lee Jones , Liam Girdwood , Mark Brown , Lars-Peter Clausen , quic_gurus@quicinc.com, Sebastian Reichel , Michael Walle , Randy Dunlap , "open list:GPIO SUBSYSTEM" , devicetree , Linux Kernel Mailing List , linux-iio , Linux PM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Fri, Jul 1, 2022 at 5:36 PM Aidan MacDonald wrote: > Andy Shevchenko writes: > > On Wed, Jun 29, 2022 at 4:30 PM Aidan MacDonald > > wrote: ... > >> +struct axp192_pctl_function { > >> + const char *name; > >> + /* Mux value written to the control register to select the function (-1 if unsupported) */ > >> + const u8 *muxvals; > >> + const char * const *groups; > >> + unsigned int ngroups; > >> +}; > > > > Can it be replaced by struct function_desc? > > https://elixir.bootlin.com/linux/latest/source/drivers/pinctrl/pinmux.h#L130 > > That'd work, but using the generic infrastructure doesn't allow me to > simplify anything -- I can eliminate three trivial functions, but the > generic code is higher overhead (extra allocations, radix trees, ...) I really don't see how it gets into extra allocations. Either way you have a pointer to opaque data or in your current code it's called muxvals. Other fields seem 1:1 what is in struct function_desc. The code will be probably the same. I.o.w. I'm talking of eliminating data type, and not about simplifying the code by fully switching to generic infrastructure. > so I'd prefer to stick with the current approach. -- With Best Regards, Andy Shevchenko