From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-aspeed@lists.ozlabs.org
Subject: [PATCH v13 2/3] i2c: aspeed: support AST2600 i2c new register mode driver
Date: Fri, 23 Aug 2024 17:03:19 +0300 [thread overview]
Message-ID: <ZsiWp5ENQ0BeBjMn@smile.fi.intel.com> (raw)
In-Reply-To: <OS8PR06MB75419F3E3A222AE941DE3007F2882@OS8PR06MB7541.apcprd06.prod.outlook.com>
On Fri, Aug 23, 2024 at 06:23:54AM +0000, Ryan Chen wrote:
> > On Thu, Aug 22, 2024 at 02:24:26AM +0000, Ryan Chen wrote:
> > > > On Wed, Aug 21, 2024 at 06:43:01AM +0000, Ryan Chen wrote:
> > > > > > On Mon, Aug 19, 2024 at 05:28:49PM +0800, Ryan Chen wrote:
...
> > > > > > > + if (i2c_bus->mode == BUFF_MODE) {
> > > > > > > + i2c_bus->buf_base =
> > > > > > devm_platform_get_and_ioremap_resource(pdev, 1, &res);
> > > > > > > + if (!IS_ERR_OR_NULL(i2c_bus->buf_base))
> > > > > > > + i2c_bus->buf_size = resource_size(res) / 2;
> > > > > > > + else
> > > > > > > + i2c_bus->mode = BYTE_MODE;
> > > > > >
> > > > > > What's wrong with positive conditional? And is it even possible
> > > > > > to have NULL here?
> > > > > >
> > > > > Yes, if dtsi fill not following yaml example have reg 1, that will
> > > > > failure at buffer
> > > > mode.
> > > > > And I can swith to byte mode.
> > > > >
> > > > > reg = <0x80 0x80>, <0xc00 0x20>;
> > > >
> > > > I was asking about if (!IS_ERR_OR_NULL(...)) line:
> > > > 1) Why 'if (!foo) {} else {}' instead of 'if (foo) {} else {}'?
> > > I will update to following.
> > > if (IS_ERR(i2c_bus->buf_base))
> > > i2c_bus->mode = BYTE_MODE;
> > > else
> > > i2c_bus->buf_size = resource_size(res) / 2;
> > >
> > > > 2) Why _NULL?
> > > If dtsi file is claim only 1 reg offset. reg = <0x80 0x80>; that will goto byte
> > mode.
> > > reg = <0x80 0x80>, <0xc00 0x20>; can support buffer mode.
> > > due to 2nd is buffer register offset.
> >
> > I have asked why IS_ERR_OR_NULL() and not IS_ERR().
> >
> OH, I will doing by this.
> if (IS_ERR_OR_NULL(i2c_bus->buf_base))
The question about _NULL remains unanswered...
> i2c_bus->mode = BYTE_MODE;
> else
> i2c_bus->buf_size = resource_size(res) / 2;
--
With Best Regards,
Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ryan Chen <ryan_chen@aspeedtech.com>
Cc: "brendan.higgins@linux.dev" <brendan.higgins@linux.dev>,
"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
"joel@jms.id.au" <joel@jms.id.au>,
"andi.shyti@kernel.org" <andi.shyti@kernel.org>,
"robh@kernel.org" <robh@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"andrew@codeconstruct.com.au" <andrew@codeconstruct.com.au>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v13 2/3] i2c: aspeed: support AST2600 i2c new register mode driver
Date: Fri, 23 Aug 2024 17:03:19 +0300 [thread overview]
Message-ID: <ZsiWp5ENQ0BeBjMn@smile.fi.intel.com> (raw)
In-Reply-To: <OS8PR06MB75419F3E3A222AE941DE3007F2882@OS8PR06MB7541.apcprd06.prod.outlook.com>
On Fri, Aug 23, 2024 at 06:23:54AM +0000, Ryan Chen wrote:
> > On Thu, Aug 22, 2024 at 02:24:26AM +0000, Ryan Chen wrote:
> > > > On Wed, Aug 21, 2024 at 06:43:01AM +0000, Ryan Chen wrote:
> > > > > > On Mon, Aug 19, 2024 at 05:28:49PM +0800, Ryan Chen wrote:
...
> > > > > > > + if (i2c_bus->mode == BUFF_MODE) {
> > > > > > > + i2c_bus->buf_base =
> > > > > > devm_platform_get_and_ioremap_resource(pdev, 1, &res);
> > > > > > > + if (!IS_ERR_OR_NULL(i2c_bus->buf_base))
> > > > > > > + i2c_bus->buf_size = resource_size(res) / 2;
> > > > > > > + else
> > > > > > > + i2c_bus->mode = BYTE_MODE;
> > > > > >
> > > > > > What's wrong with positive conditional? And is it even possible
> > > > > > to have NULL here?
> > > > > >
> > > > > Yes, if dtsi fill not following yaml example have reg 1, that will
> > > > > failure at buffer
> > > > mode.
> > > > > And I can swith to byte mode.
> > > > >
> > > > > reg = <0x80 0x80>, <0xc00 0x20>;
> > > >
> > > > I was asking about if (!IS_ERR_OR_NULL(...)) line:
> > > > 1) Why 'if (!foo) {} else {}' instead of 'if (foo) {} else {}'?
> > > I will update to following.
> > > if (IS_ERR(i2c_bus->buf_base))
> > > i2c_bus->mode = BYTE_MODE;
> > > else
> > > i2c_bus->buf_size = resource_size(res) / 2;
> > >
> > > > 2) Why _NULL?
> > > If dtsi file is claim only 1 reg offset. reg = <0x80 0x80>; that will goto byte
> > mode.
> > > reg = <0x80 0x80>, <0xc00 0x20>; can support buffer mode.
> > > due to 2nd is buffer register offset.
> >
> > I have asked why IS_ERR_OR_NULL() and not IS_ERR().
> >
> OH, I will doing by this.
> if (IS_ERR_OR_NULL(i2c_bus->buf_base))
The question about _NULL remains unanswered...
> i2c_bus->mode = BYTE_MODE;
> else
> i2c_bus->buf_size = resource_size(res) / 2;
--
With Best Regards,
Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ryan Chen <ryan_chen@aspeedtech.com>
Cc: "robh@kernel.org" <robh@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"andi.shyti@kernel.org" <andi.shyti@kernel.org>,
"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"brendan.higgins@linux.dev" <brendan.higgins@linux.dev>,
"joel@jms.id.au" <joel@jms.id.au>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH v13 2/3] i2c: aspeed: support AST2600 i2c new register mode driver
Date: Fri, 23 Aug 2024 17:03:19 +0300 [thread overview]
Message-ID: <ZsiWp5ENQ0BeBjMn@smile.fi.intel.com> (raw)
In-Reply-To: <OS8PR06MB75419F3E3A222AE941DE3007F2882@OS8PR06MB7541.apcprd06.prod.outlook.com>
On Fri, Aug 23, 2024 at 06:23:54AM +0000, Ryan Chen wrote:
> > On Thu, Aug 22, 2024 at 02:24:26AM +0000, Ryan Chen wrote:
> > > > On Wed, Aug 21, 2024 at 06:43:01AM +0000, Ryan Chen wrote:
> > > > > > On Mon, Aug 19, 2024 at 05:28:49PM +0800, Ryan Chen wrote:
...
> > > > > > > + if (i2c_bus->mode == BUFF_MODE) {
> > > > > > > + i2c_bus->buf_base =
> > > > > > devm_platform_get_and_ioremap_resource(pdev, 1, &res);
> > > > > > > + if (!IS_ERR_OR_NULL(i2c_bus->buf_base))
> > > > > > > + i2c_bus->buf_size = resource_size(res) / 2;
> > > > > > > + else
> > > > > > > + i2c_bus->mode = BYTE_MODE;
> > > > > >
> > > > > > What's wrong with positive conditional? And is it even possible
> > > > > > to have NULL here?
> > > > > >
> > > > > Yes, if dtsi fill not following yaml example have reg 1, that will
> > > > > failure at buffer
> > > > mode.
> > > > > And I can swith to byte mode.
> > > > >
> > > > > reg = <0x80 0x80>, <0xc00 0x20>;
> > > >
> > > > I was asking about if (!IS_ERR_OR_NULL(...)) line:
> > > > 1) Why 'if (!foo) {} else {}' instead of 'if (foo) {} else {}'?
> > > I will update to following.
> > > if (IS_ERR(i2c_bus->buf_base))
> > > i2c_bus->mode = BYTE_MODE;
> > > else
> > > i2c_bus->buf_size = resource_size(res) / 2;
> > >
> > > > 2) Why _NULL?
> > > If dtsi file is claim only 1 reg offset. reg = <0x80 0x80>; that will goto byte
> > mode.
> > > reg = <0x80 0x80>, <0xc00 0x20>; can support buffer mode.
> > > due to 2nd is buffer register offset.
> >
> > I have asked why IS_ERR_OR_NULL() and not IS_ERR().
> >
> OH, I will doing by this.
> if (IS_ERR_OR_NULL(i2c_bus->buf_base))
The question about _NULL remains unanswered...
> i2c_bus->mode = BYTE_MODE;
> else
> i2c_bus->buf_size = resource_size(res) / 2;
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-08-23 14:03 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 9:28 [PATCH v13 0/3] Add ASPEED AST2600 I2Cv2 controller driver Ryan Chen
2024-08-19 9:28 ` Ryan Chen
2024-08-19 9:28 ` [PATCH v13 1/3] dt-bindings: i2c: aspeed: support for AST2600-i2cv2 Ryan Chen
2024-08-19 9:28 ` Ryan Chen
2024-08-19 10:34 ` Krzysztof Kozlowski
2024-08-19 10:34 ` Krzysztof Kozlowski
2024-08-20 1:29 ` Ryan Chen
2024-08-20 1:29 ` Ryan Chen
2024-08-20 6:18 ` Krzysztof Kozlowski
2024-08-20 6:18 ` Krzysztof Kozlowski
2024-08-20 6:50 ` Ryan Chen
2024-08-20 6:50 ` Ryan Chen
2024-08-20 10:01 ` Krzysztof Kozlowski
2024-08-20 10:01 ` Krzysztof Kozlowski
2024-08-21 2:29 ` Ryan Chen
2024-08-21 2:29 ` Ryan Chen
2024-08-19 9:28 ` [PATCH v13 2/3] i2c: aspeed: support AST2600 i2c new register mode driver Ryan Chen
2024-08-19 9:28 ` Ryan Chen
2024-08-19 14:17 ` Andy Shevchenko
2024-08-19 14:17 ` Andy Shevchenko
2024-08-19 14:17 ` Andy Shevchenko
2024-08-21 6:43 ` Ryan Chen
2024-08-21 6:43 ` Ryan Chen
2024-08-21 6:43 ` Ryan Chen
2024-08-21 11:53 ` Andy Shevchenko
2024-08-21 11:53 ` Andy Shevchenko
2024-08-21 11:53 ` Andy Shevchenko
2024-08-22 2:24 ` Ryan Chen
2024-08-22 2:24 ` Ryan Chen
2024-08-22 2:24 ` Ryan Chen
2024-08-22 13:32 ` Andy Shevchenko
2024-08-22 13:32 ` Andy Shevchenko
2024-08-22 13:32 ` Andy Shevchenko
2024-08-23 6:23 ` Ryan Chen
2024-08-23 6:23 ` Ryan Chen
2024-08-23 6:23 ` Ryan Chen
2024-08-23 14:03 ` Andy Shevchenko [this message]
2024-08-23 14:03 ` Andy Shevchenko
2024-08-23 14:03 ` Andy Shevchenko
2024-08-26 7:50 ` Ryan Chen
2024-08-26 7:50 ` Ryan Chen
2024-08-26 7:50 ` Ryan Chen
2024-08-26 10:38 ` Andy Shevchenko
2024-08-26 10:38 ` Andy Shevchenko
2024-08-26 10:38 ` Andy Shevchenko
2024-08-28 2:34 ` Ryan Chen
2024-08-28 2:34 ` Ryan Chen
2024-08-28 2:34 ` Ryan Chen
2024-08-28 13:55 ` Andy Shevchenko
2024-08-28 13:55 ` Andy Shevchenko
2024-08-28 13:55 ` Andy Shevchenko
2024-08-19 15:28 ` kernel test robot
2024-08-19 15:28 ` kernel test robot
2024-08-19 17:10 ` kernel test robot
2024-08-19 17:10 ` kernel test robot
2024-08-19 9:28 ` [PATCH v13 3/3] i2c: aspeed: support AST2600 i2c new register slave " Ryan Chen
2024-08-19 9:28 ` Ryan Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZsiWp5ENQ0BeBjMn@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-aspeed@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.